Skip to content

Addition of GetInt64 #14

@GoogleCodeExporter

Description

@GoogleCodeExporter
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 [email protected] on 13 Jul 2011 at 6:02

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions