Skip to content

GetError when nothing defined on a section #6

Description

@GoogleCodeExporter
Not exactly an issue, more of a feature request.

In the usage example on the main page you've got:

## config file
[default]
host = something.com
port = 443
active = true
compression = off

[service-1]
compression = on

[service-2]
port = 444

## go program
c, err := conf.ReadConfigFile("something.config")
c.GetBool("default", "compression") // returns false
c.GetBool("service-1", "compression") // returns true
c.GetBool("service-2", "compression") // returns GetError

###

I don't think there's really a point in knowing if a setting comes from the 
default section or not so IMHO it would be nicer if c.GetBool("service-2", 
"compression") returned the relevant setting from the "default" section - it 
feels like it would make the code based on this package more elegant.

Original issue reported on code.google.com by isza...@gmail.com on 27 Jun 2010 at 12:15

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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