With the latest weekly build of Go I first ran gofix on all *.go files. Next I
had to edit the get.go and replace the GetFloat function with GetFloat32 and
GetFloat64
// GetFloat32 has the same behaviour as GetString but converts the response to
float.
func (c *ConfigFile) GetFloat64(section string, option string) (value float64,
err os.Error) {
sv, err := c.GetString(section, option)
if err == nil {
value, err = strconv.Atof64(sv)
if err != nil {
err = GetError{CouldNotParse, "float 64", sv, section, option}
}
}
return value, err
}
// GetFloat64 has the same behaviour as GetString but converts the response to
float.
func (c *ConfigFile) GetFloat32(section string, option string) (value float32,
err os.Error) {
sv, err := c.GetString(section, option)
if err == nil {
value, err = strconv.Atof32(sv)
if err != nil {
err = GetError{CouldNotParse, "float 32", sv, section, option}
}
}
return value, err
}
goconf now compiles. -- Thanks for a very promising package for go!
Original issue reported on code.google.com by rma...@gmail.com on 30 May 2011 at 2:08
Original issue reported on code.google.com by
rma...@gmail.com
on 30 May 2011 at 2:08