Uninstall

This commit is contained in:
admju
2024-09-02 11:43:11 +00:00
parent 4ae5926b01
commit 11f56722f7
9 changed files with 241 additions and 134 deletions

View File

@@ -14,6 +14,25 @@ type versionInput struct {
Version string `yaml:"version"`
}
func GetFromFile(fileversion string) (string, error) {
fin, err := os.Open(fileversion)
if err != nil {
return "", err
}
defer fin.Close()
byteValue, err := ioutil.ReadAll(fin)
if err != nil {
return "", err
}
var objmap versionInput
yaml.Unmarshal(byteValue, &objmap)
return objmap.Version, nil
}
// Get : Retourne la version
func Get(version string) (string, error) {
@@ -50,9 +69,9 @@ func readLatestFile() (string, error) {
return "", err
}
var objmap versionInput
var objmap versionInput
yaml.Unmarshal(byteValue, &objmap)
yaml.Unmarshal(byteValue, &objmap)
return objmap.Version, nil
}