rename ConfigConfigure.Check to ConfigConfigure.Validate

update sample in README.md
This commit is contained in:
2025-02-03 12:34:58 +08:00
parent c61fa68041
commit 9073d9d901
3 changed files with 14 additions and 7 deletions

View File

@@ -15,19 +15,21 @@ type ConfigConfigure struct {
ConfigureFile string
}
func (receiver *ConfigConfigure) Check() {
func (receiver *ConfigConfigure) Validate() {
if receiver.ContainerType == None {
log.Fatal("Check, ContainerType should not be None or Empty ")
log.Fatal("Validate, ContainerType should not be None or Empty")
} else if receiver.ContainerType == BesidesExe {
// pass
} else if receiver.ContainerType == UserConfig {
if receiver.AppName == "" {
log.Fatal("Check, AppName should not be None while ContainerType == UserConfig")
log.Fatal("Validate, AppName should not be None while ContainerType == UserConfig")
}
} else if receiver.ContainerType == SystemConfig {
if receiver.AppName == "" {
log.Fatal("Check, AppName should not be None while ContainerType == SystemConfig\nBesides SystemConfig is not supported for now")
log.Fatal("Validate, AppName should not be None while ContainerType == SystemConfig\nBesides SystemConfig is not supported for now")
}
} else {
log.Fatalf("Validate, ContainerType should not be %s \n", receiver.ContainerType)
}
}