Commit Graph
199 Commits
Author SHA1 Message Date
Unknwon bc525925d9 Fix typo in README 2016-12-21 06:46:49 -05:00
Unknwon 9a250b46b0 Minor fix and docs for PR #72 v1.22.0 2016-12-21 06:44:06 -05:00
George Vilchesand无闻 4b84ed0055 Added support for unparseable sections. (#72)
* Added support for unparseable sections.

* Add write support for unparseable sections.

* Slightly changed test files to make test results clearer with tools/platforms that handle whitespace differently.
2016-12-21 06:26:37 -05:00
PuHsiu, Chiangand无闻 c2daada740 Fix example code about "Section" method in README. (#70)
Changes to be committed:
	modified:   README.md
	modified:   README_ZH.md
2016-12-21 06:06:59 -05:00
Unknwon 546515cc5a Minor fix for PR #69 2016-12-21 06:06:34 -05:00
PuHsiu, Chiangand无闻 9a9c851de9 Add description of "Comment" and show how to use # or ; in value. (#69)
Changes to be committed:
	modified:   README.md
	modified:   README_ZH.md
2016-12-21 06:02:23 -05:00
Unknwon da14cebb76 Hanlde BOM for UTF-16 2016-12-21 05:59:58 -05:00
Unknwon 2ba15ac2dc Add PrettyFormat docs to README 2016-11-19 22:10:36 -05:00
Unknwon 6e4869b434 Bump version v1.21.1 2016-08-26 23:11:18 -07:00
James Bowesand无闻 3e15c67543 Support omitempty in tags during MapTo (#65)
omitempty must be ignored when unmarshalling into a struct, so that the
key name is parsed correctly.
2016-08-26 19:59:36 -07:00
Unknwon a2610b3a79 #53 support boolean type key v1.21.0 2016-08-16 21:45:43 -07:00
Unknwon cefc24de94 Bump version and add docs v1.20.0 2016-08-11 07:23:05 -07:00
Hanno Heckerand无闻 bb0ba728b1 add value expander (#35)
* add value expander

* cosmetic fixes
2016-08-11 07:17:51 -07:00
Unknwon 6b91d32e11 Fix code consistency v1.19.2 2016-08-11 06:48:09 -07:00
Unknwon f4c8d0e8b3 #62 fix value zero (0) of uint cause misjudge as time.Duration 2016-08-11 06:41:25 -07:00
Unknwon 9144852efb #61 fix struct check with time.Time v1.19.1 2016-08-05 13:04:04 -07:00
Unknwon 088ac83a7d #60 minor fix and update docs v1.19.0 2016-08-05 11:03:21 -07:00
Radek Simkoand无闻 8e15fc6d72 Add support for omitempty tag option (#60) 2016-08-05 10:45:33 -07:00
Unknwon cf53f9204d Fix Go1.4 backward compatibility v1.18.0 2016-07-09 01:31:50 +08:00
Unknwon 959d90aa69 #48 support more slice types when MapTo/ReflectFrom struct
This allows int, int64, uint, uint64 and float64 to be slice element type.
2016-07-09 00:38:25 +08:00
Unknwon 927d8d7ced Update README [CI SKIP] 2016-07-02 17:56:45 +08:00
Unknwon d84ec27dc1 #44 add load option to ignore continuation lines v1.17.0 2016-07-02 17:26:46 +08:00
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