summaryrefslogtreecommitdiff
path: root/vendor/gopkg.in
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2022-05-02 14:05:18 +0100
committerLibravatar GitHub <noreply@github.com>2022-05-02 15:05:18 +0200
commitb56dae8120d43b9acd3d3ed4d40100ffab7b972a (patch)
treed55d30589d8a8499ed3d5eecba163abc9fa78c27 /vendor/gopkg.in
parentadd extra indexes as a migration (#527) (diff)
downloadgotosocial-b56dae8120d43b9acd3d3ed4d40100ffab7b972a.tar.xz
[chore] Update all but bun libraries (#526)
* update all but bun libraries Signed-off-by: kim <grufwub@gmail.com> * remove my personal build script changes Signed-off-by: kim <grufwub@gmail.com>
Diffstat (limited to 'vendor/gopkg.in')
-rw-r--r--vendor/gopkg.in/ini.v1/.editorconfig12
-rw-r--r--vendor/gopkg.in/ini.v1/.gitignore1
-rw-r--r--vendor/gopkg.in/ini.v1/file.go23
-rw-r--r--vendor/gopkg.in/ini.v1/key.go19
4 files changed, 47 insertions, 8 deletions
diff --git a/vendor/gopkg.in/ini.v1/.editorconfig b/vendor/gopkg.in/ini.v1/.editorconfig
new file mode 100644
index 000000000..4a2d9180f
--- /dev/null
+++ b/vendor/gopkg.in/ini.v1/.editorconfig
@@ -0,0 +1,12 @@
+# http://editorconfig.org
+
+root = true
+
+[*]
+charset = utf-8
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+[*_test.go]
+trim_trailing_whitespace = false
diff --git a/vendor/gopkg.in/ini.v1/.gitignore b/vendor/gopkg.in/ini.v1/.gitignore
index 12411127b..588388bda 100644
--- a/vendor/gopkg.in/ini.v1/.gitignore
+++ b/vendor/gopkg.in/ini.v1/.gitignore
@@ -4,3 +4,4 @@ ini.sublime-workspace
testdata/conf_reflect.ini
.idea
/.vscode
+.DS_Store
diff --git a/vendor/gopkg.in/ini.v1/file.go b/vendor/gopkg.in/ini.v1/file.go
index 7b4e560d1..9d91c31a6 100644
--- a/vendor/gopkg.in/ini.v1/file.go
+++ b/vendor/gopkg.in/ini.v1/file.go
@@ -442,16 +442,16 @@ func (f *File) writeToBuffer(indent string) (*bytes.Buffer, error) {
kname = `"""` + kname + `"""`
}
- for _, val := range key.ValueWithShadows() {
+ writeKeyValue := func(val string) (bool, error) {
if _, err := buf.WriteString(kname); err != nil {
- return nil, err
+ return false, err
}
if key.isBooleanType {
if kname != sec.keyList[len(sec.keyList)-1] {
buf.WriteString(LineBreak)
}
- continue KeyList
+ return true, nil
}
// Write out alignment spaces before "=" sign
@@ -468,10 +468,27 @@ func (f *File) writeToBuffer(indent string) (*bytes.Buffer, error) {
val = `"` + val + `"`
}
if _, err := buf.WriteString(equalSign + val + LineBreak); err != nil {
+ return false, err
+ }
+ return false, nil
+ }
+
+ shadows := key.ValueWithShadows()
+ if len(shadows) == 0 {
+ if _, err := writeKeyValue(""); err != nil {
return nil, err
}
}
+ for _, val := range shadows {
+ exitLoop, err := writeKeyValue(val)
+ if err != nil {
+ return nil, err
+ } else if exitLoop {
+ continue KeyList
+ }
+ }
+
for _, val := range key.nestedValues {
if _, err := buf.WriteString(indent + " " + val + LineBreak); err != nil {
return nil, err
diff --git a/vendor/gopkg.in/ini.v1/key.go b/vendor/gopkg.in/ini.v1/key.go
index 0302c291b..a19d9f38e 100644
--- a/vendor/gopkg.in/ini.v1/key.go
+++ b/vendor/gopkg.in/ini.v1/key.go
@@ -110,15 +110,24 @@ func (k *Key) Value() string {
return k.value
}
-// ValueWithShadows returns raw values of key and its shadows if any.
+// ValueWithShadows returns raw values of key and its shadows if any. Shadow
+// keys with empty values are ignored from the returned list.
func (k *Key) ValueWithShadows() []string {
if len(k.shadows) == 0 {
+ if k.value == "" {
+ return []string{}
+ }
return []string{k.value}
}
- vals := make([]string, len(k.shadows)+1)
- vals[0] = k.value
- for i := range k.shadows {
- vals[i+1] = k.shadows[i].value
+
+ vals := make([]string, 0, len(k.shadows)+1)
+ if k.value != "" {
+ vals = append(vals, k.value)
+ }
+ for _, s := range k.shadows {
+ if s.value != "" {
+ vals = append(vals, s.value)
+ }
}
return vals
}