Update dependencies (#5518)
This commit is contained in:
7
vendor/github.com/magiconair/properties/.travis.yml
generated
vendored
7
vendor/github.com/magiconair/properties/.travis.yml
generated
vendored
@@ -1,5 +1,6 @@
|
||||
language: go
|
||||
go:
|
||||
- 1.3.x
|
||||
- 1.4.x
|
||||
- 1.5.x
|
||||
- 1.6.x
|
||||
@@ -7,4 +8,10 @@ go:
|
||||
- 1.8.x
|
||||
- 1.9.x
|
||||
- "1.10.x"
|
||||
- "1.11.x"
|
||||
- "1.12.x"
|
||||
- "1.13.x"
|
||||
- "1.14.x"
|
||||
- "1.15.x"
|
||||
- "1.16.x"
|
||||
- tip
|
||||
|
||||
29
vendor/github.com/magiconair/properties/CHANGELOG.md
generated
vendored
29
vendor/github.com/magiconair/properties/CHANGELOG.md
generated
vendored
@@ -1,5 +1,34 @@
|
||||
## Changelog
|
||||
|
||||
### [1.8.2](https://github.com/magiconair/properties/tree/v1.8.2) - 25 Aug 2020
|
||||
|
||||
* [PR #36](https://github.com/magiconair/properties/pull/36): Escape backslash on write
|
||||
|
||||
This patch ensures that backslashes are escaped on write. Existing applications which
|
||||
rely on the old behavior may need to be updated.
|
||||
|
||||
Thanks to [@apesternikov](https://github.com/apesternikov) for the patch.
|
||||
|
||||
* [PR #42](https://github.com/magiconair/properties/pull/42): Made Content-Type check whitespace agnostic in LoadURL()
|
||||
|
||||
Thanks to [@aliras1](https://github.com/aliras1) for the patch.
|
||||
|
||||
* [PR #41](https://github.com/magiconair/properties/pull/41): Make key/value separator configurable on Write()
|
||||
|
||||
Thanks to [@mkjor](https://github.com/mkjor) for the patch.
|
||||
|
||||
* [PR #40](https://github.com/magiconair/properties/pull/40): Add method to return a sorted list of keys
|
||||
|
||||
Thanks to [@mkjor](https://github.com/mkjor) for the patch.
|
||||
|
||||
### [1.8.1](https://github.com/magiconair/properties/tree/v1.8.1) - 10 May 2019
|
||||
|
||||
* [PR #35](https://github.com/magiconair/properties/pull/35): Close body always after request
|
||||
|
||||
This patch ensures that in `LoadURL` the response body is always closed.
|
||||
|
||||
Thanks to [@liubog2008](https://github.com/liubog2008) for the patch.
|
||||
|
||||
### [1.8](https://github.com/magiconair/properties/tree/v1.8) - 15 May 2018
|
||||
|
||||
* [PR #26](https://github.com/magiconair/properties/pull/26): Disable expansion during loading
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
goproperties - properties file decoder for Go
|
||||
|
||||
Copyright (c) 2013-2018 - Frank Schroeder
|
||||
Copyright (c) 2013-2020, Frank Schroeder
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3
vendor/github.com/magiconair/properties/README.md
generated
vendored
3
vendor/github.com/magiconair/properties/README.md
generated
vendored
@@ -1,6 +1,5 @@
|
||||
[](https://github.com/magiconair/properties/releases)
|
||||
[](https://travis-ci.org/magiconair/properties)
|
||||
[](https://app.codeship.com/projects/274177")
|
||||
[](https://raw.githubusercontent.com/magiconair/properties/master/LICENSE)
|
||||
[](http://godoc.org/github.com/magiconair/properties)
|
||||
|
||||
@@ -30,7 +29,7 @@ changed from `panic` to `log.Fatal` but this is configurable and custom
|
||||
error handling functions can be provided. See the package documentation for
|
||||
details.
|
||||
|
||||
Read the full documentation on [GoDoc](https://godoc.org/github.com/magiconair/properties) [](https://godoc.org/github.com/magiconair/properties)
|
||||
Read the full documentation on [](http://godoc.org/github.com/magiconair/properties)
|
||||
|
||||
## Getting Started
|
||||
|
||||
|
||||
7
vendor/github.com/magiconair/properties/load.go
generated
vendored
7
vendor/github.com/magiconair/properties/load.go
generated
vendored
@@ -115,6 +115,7 @@ func (l *Loader) LoadURL(url string) (*Properties, error) {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("properties: error fetching %q. %s", url, err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
if resp.StatusCode == 404 && l.IgnoreMissing {
|
||||
LogPrintf("properties: %s returned %d. skipping", url, resp.StatusCode)
|
||||
@@ -129,14 +130,14 @@ func (l *Loader) LoadURL(url string) (*Properties, error) {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("properties: %s error reading response. %s", url, err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
ct := resp.Header.Get("Content-Type")
|
||||
ct = strings.Join(strings.Fields(ct), "")
|
||||
var enc Encoding
|
||||
switch strings.ToLower(ct) {
|
||||
case "text/plain", "text/plain; charset=iso-8859-1", "text/plain; charset=latin1":
|
||||
case "text/plain", "text/plain;charset=iso-8859-1", "text/plain;charset=latin1":
|
||||
enc = ISO_8859_1
|
||||
case "", "text/plain; charset=utf-8":
|
||||
case "", "text/plain;charset=utf-8":
|
||||
enc = UTF8
|
||||
default:
|
||||
return nil, fmt.Errorf("properties: invalid content type %s", ct)
|
||||
|
||||
31
vendor/github.com/magiconair/properties/properties.go
generated
vendored
31
vendor/github.com/magiconair/properties/properties.go
generated
vendored
@@ -8,11 +8,13 @@ package properties
|
||||
// BUG(frank): Write() does not allow to configure the newline character. Therefore, on Windows LF is used.
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -69,6 +71,9 @@ type Properties struct {
|
||||
|
||||
// Stores the keys in order of appearance.
|
||||
k []string
|
||||
|
||||
// WriteSeparator specifies the separator of key and value while writing the properties.
|
||||
WriteSeparator string
|
||||
}
|
||||
|
||||
// NewProperties creates a new Properties struct with the default
|
||||
@@ -111,7 +116,7 @@ func (p *Properties) Get(key string) (value string, ok bool) {
|
||||
// circular references and malformed expressions
|
||||
// so we panic if we still get an error here.
|
||||
if err != nil {
|
||||
ErrorHandler(fmt.Errorf("%s in %q", err, key+" = "+v))
|
||||
ErrorHandler(err)
|
||||
}
|
||||
|
||||
return expanded, true
|
||||
@@ -586,6 +591,12 @@ func (p *Properties) String() string {
|
||||
return s
|
||||
}
|
||||
|
||||
// Sort sorts the properties keys in alphabetical order.
|
||||
// This is helpfully before writing the properties.
|
||||
func (p *Properties) Sort() {
|
||||
sort.Strings(p.k)
|
||||
}
|
||||
|
||||
// Write writes all unexpanded 'key = value' pairs to the given writer.
|
||||
// Write returns the number of bytes written and any write error encountered.
|
||||
func (p *Properties) Write(w io.Writer, enc Encoding) (n int, err error) {
|
||||
@@ -626,7 +637,7 @@ func (p *Properties) WriteComment(w io.Writer, prefix string, enc Encoding) (n i
|
||||
}
|
||||
|
||||
for _, c := range comments {
|
||||
x, err = fmt.Fprintf(w, "%s%s\n", prefix, encode(c, "", enc))
|
||||
x, err = fmt.Fprintf(w, "%s%s\n", prefix, c)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -635,8 +646,11 @@ func (p *Properties) WriteComment(w io.Writer, prefix string, enc Encoding) (n i
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
x, err = fmt.Fprintf(w, "%s = %s\n", encode(key, " :", enc), encode(value, "", enc))
|
||||
sep := " = "
|
||||
if p.WriteSeparator != "" {
|
||||
sep = p.WriteSeparator
|
||||
}
|
||||
x, err = fmt.Fprintf(w, "%s%s%s\n", encode(key, " :", enc), sep, encode(value, "", enc))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -753,7 +767,12 @@ func expand(s string, keys []string, prefix, postfix string, values map[string]s
|
||||
|
||||
for _, k := range keys {
|
||||
if key == k {
|
||||
return "", fmt.Errorf("circular reference")
|
||||
var b bytes.Buffer
|
||||
b.WriteString("circular reference in:\n")
|
||||
for _, k1 := range keys {
|
||||
fmt.Fprintf(&b, "%s=%s\n", k1, values[k1])
|
||||
}
|
||||
return "", fmt.Errorf(b.String())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -820,6 +839,8 @@ func escape(r rune, special string) string {
|
||||
return "\\r"
|
||||
case '\t':
|
||||
return "\\t"
|
||||
case '\\':
|
||||
return "\\\\"
|
||||
default:
|
||||
if strings.ContainsRune(special, r) {
|
||||
return "\\" + string(r)
|
||||
|
||||
Reference in New Issue
Block a user