config.go
changeset 50 80a09cf62225
parent 49 b48dafc1fd4f
child 51 4a0533d00053
equal deleted inserted replaced
49:b48dafc1fd4f 50:80a09cf62225
    78 		buf, err := ioutil.ReadFile(file)
    78 		buf, err := ioutil.ReadFile(file)
    79 		if err != nil {
    79 		if err != nil {
    80 			return s, fmt.Errorf("Can not read %s", file)
    80 			return s, fmt.Errorf("Can not read %s", file)
    81 		}
    81 		}
    82 
    82 
    83 		err = toml.Unmarshal(buf, s)
    83 		var sc Server
       
    84 
       
    85 		err = toml.Unmarshal(buf, &sc)
    84 		if err != nil {
    86 		if err != nil {
    85 			return s, fmt.Errorf("Error parsing toml %s: %v", file, err)
    87 			return s, fmt.Errorf("Error parsing toml %s: %v", file, err)
    86 		}
    88 		}
       
    89 		s = &sc
    87 	}
    90 	}
    88 	return
    91 	return
    89 }
    92 }
    90 
    93 
    91 func GetInstanceList() (list []string) {
    94 func GetInstanceList() (list []string) {