eureka.go: add bool config option type to parser, fix logic for multilinestring
This commit is contained in:
parent
645dd26393
commit
e3f0edeb58
1 changed files with 7 additions and 2 deletions
|
@ -321,7 +321,7 @@ func (self *EurekaAdapter) readCfg() error {
|
|||
v := strings.TrimSpace(strings.Join(tokens[1:], " "))
|
||||
|
||||
if strings.Contains(v, "\"") {
|
||||
if strings.Contains(v, "\\\r\n") || strings.Contains(v, "\\\n") {
|
||||
if strings.HasSuffix(k, "_HTML") {
|
||||
// process multiline string
|
||||
lines := strings.Split(v, "\n")
|
||||
cleanedString := ""
|
||||
|
@ -363,9 +363,13 @@ func (self *EurekaAdapter) readCfg() error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
cfgType := "int"
|
||||
if strings.HasPrefix(k, "IS_") {
|
||||
cfgType = "bool"
|
||||
}
|
||||
self.Config[ConfigOption{
|
||||
Name: k,
|
||||
Type: "int",
|
||||
Type: cfgType,
|
||||
}] = v
|
||||
}
|
||||
}
|
||||
|
@ -383,6 +387,7 @@ func (self *EurekaAdapter) writeCfg() error {
|
|||
for k, v := range self.Config {
|
||||
switch k.Type {
|
||||
case "int":
|
||||
case "bool":
|
||||
_, err := strconv.ParseInt(v, 10, 64)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in a new issue