Skip to content

GetOptions seems to be returning default section options twice #22

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?

See attached code which is simple program to walk the sections in a config file 
and list the options and their values for each section.

What is the expected output? What do you see instead?

Would expect to see the section name (default) followed by one line for the one 
option and value. Instead see two duplicate lines of the same option and value. 
Looking at the GetOptions source code, it looks like this may be intended, but 
it would not be what I would expect.

What version of the product are you using? On what operating system?

Current (May 8, 2012) of goconf, Go v1.0.2 on Windows 7 64-bit.

Please provide any additional information below.

See attached file for source code to reproduce. Note that if a config file 
doesn't exist it creates one first (also attached). Also note that even if you 
remove the section name [default] from the config file GetOptions still returns 
the host option name twice.

Original issue reported on code.google.com by jim.lehmer on 23 Sep 2012 at 6:52

Attachments:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions