mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
Update github.com/DisposaBoy/JsonConfigReader (#514)
This commit is contained in:
1
vendor/github.com/DisposaBoy/JsonConfigReader/AUTHORS.md
generated
vendored
1
vendor/github.com/DisposaBoy/JsonConfigReader/AUTHORS.md
generated
vendored
@ -2,3 +2,4 @@ This is the official list of JsonConfigReader authors for copyright purposes.
|
||||
|
||||
* DisposaBoy `https://github.com/DisposaBoy`
|
||||
* Steven Osborn `https://github.com/steve918`
|
||||
* Andreas Jaekle `https://github.com/ekle`
|
||||
|
16
vendor/github.com/DisposaBoy/JsonConfigReader/README.md
generated
vendored
16
vendor/github.com/DisposaBoy/JsonConfigReader/README.md
generated
vendored
@ -1,6 +1,14 @@
|
||||
[](https://travis-ci.org/DisposaBoy/JsonConfigReader)
|
||||
|
||||
<hr/>
|
||||
|
||||
|
||||
|
||||
|
||||
JsonConfigReader is a proxy for [golang's io.Reader](http://golang.org/pkg/io/#Reader) that strips line comments and trailing commas, allowing you to use json as a *reasonable* config format.
|
||||
|
||||
Comments start with `//` and continue to the end of the line.
|
||||
Multiline comments are also supported with `/*` and `*/`.
|
||||
|
||||
If a trailing comma is in front of `]` or `}` it will be stripped as well.
|
||||
|
||||
@ -9,9 +17,15 @@ Given `settings.json`
|
||||
|
||||
{
|
||||
"key": "value", // k:v
|
||||
|
||||
|
||||
// a list of numbers
|
||||
"list": [1, 2, 3],
|
||||
|
||||
/*
|
||||
a list of numbers
|
||||
which are important
|
||||
*/
|
||||
"numbers": [1, 2, 3],
|
||||
}
|
||||
|
||||
|
||||
|
18
vendor/github.com/DisposaBoy/JsonConfigReader/reader.go
generated
vendored
18
vendor/github.com/DisposaBoy/JsonConfigReader/reader.go
generated
vendored
@ -25,6 +25,24 @@ func consumeComment(s []byte, i int) int {
|
||||
s[i] = ' '
|
||||
}
|
||||
}
|
||||
if i < len(s) && s[i] == '*' {
|
||||
s[i-1] = ' '
|
||||
s[i] = ' '
|
||||
for ; i < len(s); i += 1 {
|
||||
if s[i] != '*' {
|
||||
s[i] = ' '
|
||||
} else {
|
||||
s[i] = ' '
|
||||
i++
|
||||
if i < len(s) {
|
||||
if s[i] == '/' {
|
||||
s[i] = ' '
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return i
|
||||
}
|
||||
|
||||
|
5
vendor/vendor.json
vendored
5
vendor/vendor.json
vendored
@ -15,9 +15,10 @@
|
||||
"revisionTime": "2016-09-16T22:17:49Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "3GJ+FRKP1nniJMokdcb/ZEcq3tE=",
|
||||
"path": "github.com/DisposaBoy/JsonConfigReader",
|
||||
"revision": "33a99fdf1d5ee1f79b5077e9c06f955ad356d5f4",
|
||||
"revisionTime": "2013-01-12T09:33:55Z"
|
||||
"revision": "5ea4d0ddac554439159cd6f191cb94a110d73352",
|
||||
"revisionTime": "2017-12-18T18:09:44Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "E0NbOzBCBYViPKvM4XcloBu6GWE=",
|
||||
|
Reference in New Issue
Block a user