Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Addition of GetInt64 #14

Open
GoogleCodeExporter opened this issue Apr 26, 2015 · 0 comments
Open

Addition of GetInt64 #14

GoogleCodeExporter opened this issue Apr 26, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

I needed to be able to get an Int64 from the config file. So I simply copied 
the GetInt and made it return a int64:

// GetInt64 has the same behaviour as GetString but converts the response to 
int64.
func (c *ConfigFile) GetInt64 (section string, option string) (value int64, err 
os.Error) {
        sv, err := c.GetString(section, option)
        if err == nil {
                value, err = strconv.Atoi64(sv)
                if err != nil {
                        err = GetError{CouldNotParse, "int64", sv, section, option}
                }
        }

        return value, err
}

Just wanted to submit this so it can make it into future releases.  -- Thanks!

Original issue reported on code.google.com by rma...@gmail.com on 13 Jul 2011 at 6:02

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant