kuangchanglang / goconf

Automatically exported from code.google.com/p/goconf
0 stars 0 forks source link

GetOptions seems to be returning default section options twice #22

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
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: