Commit Graph
127 Commits
Author SHA1 Message Date
Unknwon a219cd2c4f Go1.4 compatibility v1.16.1 2016-06-30 04:59:49 +08:00
Unknwon 911580e203 #46 Bump version v1.16.0 2016-06-30 04:48:53 +08:00
Ian Campbelland无闻 9831c78f04 Match last ] in line when parsing Section header (#46)
I have a config.ini where section names can contain "]", which leads to parse
errors. While proper support for quoting would be best (issue #32) simply
matching the last "]" rather than the first helps in this case.
2016-06-30 04:45:38 +08:00
Unknwon e0f460c8b6 #45 Must... methods assign default value when void v1.15.0 2016-06-30 00:25:09 +08:00
Unknwon a2614a51e8 update travis script v1.14.0 2016-06-29 20:31:17 +08:00
Unknwon 2cd302aa78 #36 support case insensitive load
- Use Travis CI
2016-06-29 20:27:58 +08:00
Unknwon 81d9577135 #55 add test case v1.13.0 2016-06-27 15:52:30 +08:00
ryakaand无闻 128f6e4f9e Fix panic from incorrect alignment length calculation (#55)
The alignment length calculation did not take into account that
keys may be added to if they contained "\"", "=", ":", or "`".

This gave an under calculation and resulted in index out of
bounds when this happened to be the longest key.
2016-06-27 15:42:28 +08:00
Andrii Loshkovskyiand无闻 1dc62999c1 Fix calls for KeysHash() in README files (#42) 2016-06-27 05:08:58 +08:00
Unknwon 72ba3e6b9e #52 bump version and docs v1.12.0 2016-06-01 12:11:21 -07:00
AT1012andUnknwon d291594290 Retrieve parent keys accessible from a child section (#52)
Retrieve parent keys available to a child section
2016-06-01 12:00:29 -07:00
Unknwon 12f418cc7e Bump version v1.11.0 2016-03-21 19:18:31 -04:00
Unknwon f4b7b2c842 Merge pull request #38 from nextrevision/default-header
Add support for explicitly writing a header in the DEFAULT section
2016-03-21 19:16:42 -04:00
nextrevision 30c8783cfe Add support for explicitly writing a header in the DEFAULT section 2016-03-21 16:41:28 -04:00
Unknwon 776aa739ce #33 create default section for nonexistent files in loose mode v1.10.1 2016-02-22 18:24:41 -05:00
Unknwon c83bc2f5e9 Add docs for LooseLoad v1.10.0 2016-02-22 16:27:18 -05:00
Unknwon 7e829a0d01 Minor fix for #34
Fix error check logic and wrong test cases
2016-02-22 16:17:35 -05:00
Unknwon 40c7ebf076 Merge pull request #34 from alessio/loose-load
Add LooseLoad - fix #33
2016-02-22 15:54:06 -05:00
Alessio Treglia 496d0afe56 Add LooseLoad - fix #33
A common practice in applications development is to allow the user
to customise/extend program's settings by overriding global defaults
set in system-wide config files (typically installed under /etc)
with site-specific copies (e.g. /usr/local/etc) and user-specific
files generally stored in the user's home directory. It must be
noticed that this cascade approach allows the user to specify only
those options that he wishes to override, whilst the other values
will keep their value already set in the other configuration
files. In general, when a program couldn't find any configuration
file rather than crashing it falls back to hardcoded default values.

These changes introduce a new function LooseLoad that allows the
caller to pass a slice of filenames without worrying about their
existence or not. LooseLoad will attempt to load them in order.
If a file doesn't just, it will just be ignored and the function
won't return any error. In case no files existed, an empty
configuration will be returned to the caller.

This functionality is inspired by the Python's standard library
configparser.RawConfigParser.read() function:

 https://docs.python.org/2/library/configparser.html#ConfigParser.RawConfigParser.read
2016-02-22 20:21:12 +00:00
Alessio Treglia e698a3b8d9 Add LooseLoad's test case 2016-02-22 20:20:43 +00:00
Unknwon f461e76789 Reorganize files and change behavior of pretty format 2016-02-20 01:16:12 -05:00
Unknwon 193d1ecb46 Add docs for new methods
Add use examples for new method serials 'Valid...' and 'Strict...'
v1.9.0
2016-02-07 11:33:30 -05:00
Unknwon 2a59b714f3 Merge pull request #31 from lyobzik/exclude-errors-from-list
Exclude not parsed values from lists.
2016-02-07 11:14:00 -05:00
lyobzik 3799344101 Add list methods that return error on first invalid value. 2016-02-07 21:18:56 +06:00
lyobzik 86f857a3e6 Add list methods that exclude not parsed values from lists 2016-02-06 17:24:36 +06:00
lyobzik 6ba915f74f Comment what methods will do with invalid input. 2016-02-02 23:16:00 +06:00
lyobzik 789fc31c37 Revert "Exclude not parsed values from lists."
This reverts commit 3977ef18a1.
2016-02-02 22:29:19 +06:00
lyobzik 3977ef18a1 Exclude not parsed values from lists. 2016-01-23 00:02:55 +06:00
Unknwon afbd495e5a bump version v1.8.6 2016-01-06 18:56:16 +08:00
Unknwon 68e39cc83a Merge pull request #28 from woniu369/patch-1
Update ini.go
2016-01-06 18:50:46 +08:00
Unknwon 887c8d36f8 Merge pull request #30 from shawnps/patch-2
fix typos
2015-12-31 21:02:31 -05:00
Shawn Smith 73ede7750a fix typos 2015-12-31 14:32:56 +09:00
woniu369 c6b69ec22f Update ini.go 2015-12-21 17:39:27 +08:00
woniu369 1b4602ba4a Update ini.go 2015-12-21 03:17:26 +08:00
woniu369 b91200511e Update ini.go 2015-12-21 03:06:10 +08:00
Unknwon 6ec4abd8f8 add -t docs 2015-12-17 22:34:33 -05:00
Unknwon 467243bad6 README 2015-12-16 00:35:07 -05:00
Unknwon 77178f2269 bump version and make tag v1.8.5 2015-12-16 00:30:49 -05:00
Unknwon de765479a5 Merge pull request #26 from ahmetalpbalkan/bool-yn
Add `y`/`n` as options for BOOL values
2015-12-15 21:53:47 -05:00
Ahmet Alp Balkan 62f9a5e184 Add y/n as options for BOOL values
`y`/`n` are also used as boolean values sometimes, extending
the library to infer these values for parseBool as well.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-12-15 18:34:26 -08:00
Unknwon a4e5487f4a fix panic when have empty values 2015-12-11 16:51:11 -05:00
Unknwon 9314fb0ef6 fix default mapping error 2015-12-10 12:26:54 -05:00
Unknwon 9f4d2712cf fix #25 2015-12-07 23:17:02 -05:00
Unknwon 9cd12f2950 fix key hash not updated when call SetValue 2015-12-07 11:26:11 -05:00
Unknwon 65f8c74913 refactor parser 2015-12-06 01:34:00 -05:00
Unknwon 3c26913185 Merge pull request #24 from Timmmm/master
Better comments support
2015-12-03 13:22:36 -05:00
Tim Hutt 38496d948b Better comments support
This adds support for comments on the end of section headers, e.g.

    [a_section] ; A comment

It also fixes a couple of places where only `#` comments were supports - not `;` comments.

Test cases are included (they pass).
2015-12-03 14:40:47 +00:00
Unknwon 641bc9176a Merge pull request #22 from jds/v1
Make method name Section.HasKey match documentation.
2015-12-02 13:50:19 -05:00
Joe Strickler c680b35615 Minor documentation fix for Section.HasValue. 2015-12-02 11:25:55 -05:00
Joe Strickler ff54144c0a Makes method name Section.HasKey match documentation.
The previous name, Section.Haskey, has been kept for backwards compatibility.
2015-12-02 11:23:53 -05:00