171 Commits
Author SHA1 Message Date
91a7cdb4a0 ci: migrate from Travis to GitHub Actions (#230)
* ci: migrate from Travis to GitHub Actions

* Setting up GOPATH

* Download dependencies

* Fix GOPATH

* Fix GOPATH

* Fix GOPATH

* Fix deps

* Damn it!

* ???

* Init Go mod

* Fix lint errors

* Fix failing tests on Windows

* Skip some tests on Windows

Co-authored-by: Sourcegraph Bot <campaigns@sourcegraph.com>
2020-03-28 14:26:37 +08:00
aligatorandGitHub faf04e23c2 file: support non-unique sections (#220)
* Support for non unique sections. Enabled with the option AllowNonUniqueSections.

* Non unique section support for MapToStruct

* Non unique section support for section.MapTo

* implement ini.ReflectFrom() for non unique sections

* implement xyz.Section("xyz").ReflectFrom() for non unique sections

* Refactor suggested changes after review

* remove GetSectionCount

* do not initialize sectionList if NonUniqueSections are disabled

* add test for deleting all sections of the same name

* refactor mapAllTo

* refactor ReflectFrom

* fix some comments

* refactoring based on PR suggestions

* update DeleteSectionWithIndex error
2020-03-15 19:21:17 +08:00
8e0f5b3a15 file: customize output delimiter (#226)
* customization output delimiter

* rename KeyValueDelimitersOutput to KeyValueDelimiterOnWrite

* add test for writing with KeyValueDelimiterOnWrite

* bugfix: use '=' as the default delimiter on write

Co-authored-by: Chaliy Roman <cerebrum.ch@gmail.com>
2020-03-07 22:35:44 +08:00
ᴜɴᴋɴᴡᴏɴ 90207e2a6a ini: remove internal version 2020-03-07 14:15:30 +08:00
Joe Chen 32cf4f7e9c Bump version 2020-01-31 20:28:19 +08:00
UnknwonandGitHub 94291fffe2 Bump version 2019-12-25 10:25:40 +08:00
UnknwonandGitHub 87e589f491 Bump version 2019-11-09 13:43:49 -08:00
Unknwon 8ee0b78994 Bump version 2019-11-05 20:13:40 -08:00
0f135c99ab Large python style multiline value fix (#210)
* fixed mutliline value handling

* added debug messages

* modified regex to allow empty string after indent

* multiline value indentation is determined by first indented value line

* fixed Python-style multiline value support

* fixed it

* fixed it

* cleaned up debug code

* fixed imported package name for new test file

* reversed change

* fixed import

* made changes as requested by github reviewer

* fixed build error

* added test case for large values

* incorporated second round of comments

* fixed import to point to original repo

* made Debug option a function to allow custom implementation
made other changes as requested

* removed bogus import (added by GoLand)

* simplified debug function args

* made changes as requested

* fixed format error

* made requested changes


Co-authored-by: Joerg Reichelt <joreiche@cisco.com>
2019-11-05 20:12:48 -08:00
Unknwon 1eb383f13c Bump version 2019-10-17 18:14:14 -07:00
unknwon 7007817597 Bump version 2019-09-22 23:11:19 -07:00
unknwon 6ba806069d Bump version 2019-09-18 17:15:19 -07:00
unknwon 8fe474341f *: some move around 2019-08-06 22:36:05 -07:00
unknwon d4cae42d39 Bump version 2019-08-04 23:45:50 -07:00
unknwon 5cf43420b0 Disable Go module and import path enforcement 2019-08-04 23:44:58 -07:00
unknwon 39a1505cbc Bump version 2019-08-04 13:13:54 -07:00
unknwon a7193e3188 ini: enforce canonical import path 2019-08-03 19:48:27 -07:00
unknwon 27a23941b3 Bump version 2019-08-03 19:39:54 -07:00
Unknwon 8659100d2d struct: reflect slice elements to shadows when 'allowShadow' tag is presented (#196) 2019-07-06 22:25:57 -07:00
Unknwon 2d4014bce1 parser: remove unnecessary new variable
Related to #194
2019-07-06 20:31:29 -07:00
Unknwon 2b9e6cf7b5 Bump version 2019-07-06 19:50:44 -07:00
Unknwon d79353dad8 *: fix golint complaints 2019-03-26 19:30:17 -04:00
Unknwon ece0e89bb0 *: refactor constants to use camelcase 2019-02-17 14:54:15 -05:00
Unknwon c85607071c Bump version 2019-02-17 14:36:56 -05:00
drakkanand无闻 8b99162dcd parser: add option to preserve surrounded quote (#182) 2019-02-17 14:31:27 -05:00
Unknwon 6ed8d5f64c Bump version 2019-01-03 09:53:35 +08:00
Unknwon c498c36b6f Bump version 2018-12-22 09:55:11 -05:00
Unknwon f55231ca73 struct: fix integer overflow in time.Duration conversion (#175) 2018-12-10 23:59:31 -05:00
Unknwon b194b0c75f file: trim space for original comment before prepending (#163) 2018-12-03 22:41:56 -05:00
Unknwon ffaaebdac6 parser: remove unreachable code (#170) 2018-12-02 19:56:02 -05:00
Unknwon 8d6d08321b file: support custom key-value delimiters (#166) 2018-10-14 19:40:43 -04:00
Unknwon 7b29465103 Bump version 2018-09-30 13:34:52 -04:00
haroldHTand无闻 5b4a947444 file: add DefaultFormat option around equal sign (#164)
Add option to have padding spaces around equal sign when PrettyFormat is disabled #161

eg:

> ini.PrettyFormat = false
>         ini.DefaultFormatLeft = "  "
>         ini.DefaultFormatRight = " "
2018-09-30 13:33:52 -04:00
Unknwon 5cf292cae4 file: fix incorrect multiline comment handling when write out (#157) 2018-08-18 19:46:59 +08:00
Pixdigitand无闻 d58d458bec ini: fix doc for ShadowLoad (#154) 2018-07-23 18:44:51 +08:00
Unknwon 358ee76639 section: fix s.keyHash not updated with data overwrite (#149) 2018-07-12 21:10:51 +08:00
Unknwon af26abd521 parser: support SkipUnrecognizableLines (#150) 2018-07-11 21:03:03 +08:00
Unknwon fa6ee696e4 ini: change minimum Go requirement to 1.6 2018-07-11 20:55:23 +08:00
Unknwon 06f5f3d672 Bump version 2018-05-27 06:45:42 +08:00
Anton Antonovand无闻 7af1ffd45d parser: support ignore inline comment (#146)
Edge case has a value that contains an inline symbol such as `;` or `#`.

Currently parsing a value such as:

```
value = val#ue
```

would result into just `val` if `IgnoreInlineComment` is false.

If `IgnoreInlineComment` is true it would result into the full value, but it's incorrect to depend on this.

With the fix value would be parsed as `val#ue`.
2018-05-27 06:39:42 +08:00
Unknwon 6529cf7c58 Bump version 2018-04-20 10:56:02 -04:00
Anton Antonovand无闻 ecf73439ed ini: support Python multi-line values (#145)
* [GH-144] Support Python multi-line values
2018-04-20 10:53:26 -04:00
Unknwon ace140f734 Bump version 2018-04-12 18:04:31 -04:00
Jason L. Shifferand无闻 c51d513271 file: add Support for spaces around '=' w/o PrettyFormat (#143)
The default git config format is equivalent to PrettyFormat w/o
alignment (i.e. just spaces around '=') and SaveToIndent(..., "\t")

This patch allows for setting PrettyFormat=false and PrettySpaces=True
to achieve the same output as the git config default.

It is backwards compatible in that current use case output will not be
affected unless you specifically disable PrettyFormat AND enable
PrettySpaces.
2018-04-12 18:02:29 -04:00
Unknwon 5e9692864e file: support multiline comments 2018-04-02 20:54:27 -04:00
Unknwon 6333e38ac2 file: use lock to secure concurrent operations on sections (#135) 2018-03-08 04:54:59 -05:00
Unknwon 32e4be5f41 *_test: use golden file for complex test output 2018-02-14 05:17:53 -05:00
Unknwon 32e4c1e6bc key: support nested values (#131)
Docs: http://docs.aws.amazon.com/cli/latest/topic/config-vars.html#nested-values
2017-11-19 00:34:21 -05:00
Unknwon 7e7da45132 key: add test for recursive values (#130) 2017-11-13 20:13:26 -05:00
Unknwon a343d9870e ini: add load option UnescapeValueCommentSymbols (#129) 2017-11-13 19:34:40 -05:00