rename ConfigConfigure.Check to ConfigConfigure.Validate
update sample in README.md
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user