mirror of
1
Fork 0

[chore]: Bump codeberg.org/gruf/go-kv from 1.6.3 to 1.6.4 (#2142)

This commit is contained in:
dependabot[bot] 2023-08-21 06:54:30 +00:00 committed by GitHub
parent 59b5ed6638
commit 70d87f0ff0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 36 deletions

2
go.mod
View File

@ -10,7 +10,7 @@ require (
codeberg.org/gruf/go-errors/v2 v2.2.0 codeberg.org/gruf/go-errors/v2 v2.2.0
codeberg.org/gruf/go-fastcopy v1.1.2 codeberg.org/gruf/go-fastcopy v1.1.2
codeberg.org/gruf/go-iotools v0.0.0-20230601182242-d933b07dcbef codeberg.org/gruf/go-iotools v0.0.0-20230601182242-d933b07dcbef
codeberg.org/gruf/go-kv v1.6.3 codeberg.org/gruf/go-kv v1.6.4
codeberg.org/gruf/go-logger/v2 v2.2.1 codeberg.org/gruf/go-logger/v2 v2.2.1
codeberg.org/gruf/go-mutexes v1.1.5 codeberg.org/gruf/go-mutexes v1.1.5
codeberg.org/gruf/go-runners v1.6.1 codeberg.org/gruf/go-runners v1.6.1

4
go.sum
View File

@ -66,8 +66,8 @@ codeberg.org/gruf/go-hashenc v1.0.2 h1:U3jH6zMXZiL96czD/qaJd8OR2h7LlBzGv/2WxnMHI
codeberg.org/gruf/go-hashenc v1.0.2/go.mod h1:eK+A8clLcEN/m1nftNsRId0kfYDQnETnuIfBGZ8Gvsg= codeberg.org/gruf/go-hashenc v1.0.2/go.mod h1:eK+A8clLcEN/m1nftNsRId0kfYDQnETnuIfBGZ8Gvsg=
codeberg.org/gruf/go-iotools v0.0.0-20230601182242-d933b07dcbef h1:3Ydviw47TFEk27FRCOXkRxU3MfgyNzoicLzq8J3NbtI= codeberg.org/gruf/go-iotools v0.0.0-20230601182242-d933b07dcbef h1:3Ydviw47TFEk27FRCOXkRxU3MfgyNzoicLzq8J3NbtI=
codeberg.org/gruf/go-iotools v0.0.0-20230601182242-d933b07dcbef/go.mod h1:B8uq4yHtIcKXhBZT9C/SYisz25lldLHMVpwZPz4ADLQ= codeberg.org/gruf/go-iotools v0.0.0-20230601182242-d933b07dcbef/go.mod h1:B8uq4yHtIcKXhBZT9C/SYisz25lldLHMVpwZPz4ADLQ=
codeberg.org/gruf/go-kv v1.6.3 h1:RrAhVGzAq+kU3WPR0gl1gqKnYks+prpUpa8+xDzoQXA= codeberg.org/gruf/go-kv v1.6.4 h1:3NZiW8HVdBM3kpOiLb7XfRiihnzZWMAixdCznguhILk=
codeberg.org/gruf/go-kv v1.6.3/go.mod h1:O/YkSvKiS9XsRolM3rqCd9YJmND7dAXu9z+PrlYO4bc= codeberg.org/gruf/go-kv v1.6.4/go.mod h1:O/YkSvKiS9XsRolM3rqCd9YJmND7dAXu9z+PrlYO4bc=
codeberg.org/gruf/go-logger/v2 v2.2.1 h1:RP2u059EQKTBFV3cN8X6xDxNk2RkzqdgXGKflKqB7Oc= codeberg.org/gruf/go-logger/v2 v2.2.1 h1:RP2u059EQKTBFV3cN8X6xDxNk2RkzqdgXGKflKqB7Oc=
codeberg.org/gruf/go-logger/v2 v2.2.1/go.mod h1:m/vBfG5jNUmYXI8Hg9aVSk7Pn8YgEBITQB/B/CzdRss= codeberg.org/gruf/go-logger/v2 v2.2.1/go.mod h1:m/vBfG5jNUmYXI8Hg9aVSk7Pn8YgEBITQB/B/CzdRss=
codeberg.org/gruf/go-mangler v1.2.3 h1:sj0dey2lF5GRQL7fXmCY0wPNaI5JrROiThb0VDbzF8A= codeberg.org/gruf/go-mangler v1.2.3 h1:sj0dey2lF5GRQL7fXmCY0wPNaI5JrROiThb0VDbzF8A=

View File

@ -80,7 +80,7 @@ func Byte2Str(c byte) string {
return `\t` return `\t`
case '\v': case '\v':
return `\v` return `\v`
case '\'': case '\\':
return `\\` return `\\`
default: default:
if c < ' ' { if c < ' ' {

View File

@ -18,7 +18,9 @@ func AppendQuoteString(buf *byteutil.Buffer, str string) {
case len(str) == 1: case len(str) == 1:
// Append quote single byte. // Append quote single byte.
appendQuoteByte(buf, str[0]) buf.B = append(buf.B, '\'')
buf.B = append(buf.B, format.Byte2Str(str[0])...)
buf.B = append(buf.B, '\'')
return return
case len(str) > format.SingleTermLine || !format.IsSafeASCII(str): case len(str) > format.SingleTermLine || !format.IsSafeASCII(str):
@ -63,7 +65,9 @@ func AppendQuoteValue(buf *byteutil.Buffer, str string) {
case len(str) == 1: case len(str) == 1:
// Append quote single byte. // Append quote single byte.
appendQuoteByte(buf, str[0]) buf.B = append(buf.B, '\'')
buf.B = append(buf.B, format.Byte2Str(str[0])...)
buf.B = append(buf.B, '\'')
return return
case len(str) > format.SingleTermLine || !format.IsSafeASCII(str): case len(str) > format.SingleTermLine || !format.IsSafeASCII(str):
@ -115,35 +119,6 @@ func AppendQuoteValue(buf *byteutil.Buffer, str string) {
return return
} }
// appendEscapeByte will append byte to buffer, quoting and escaping where necessary.
func appendQuoteByte(buf *byteutil.Buffer, c byte) {
switch c {
// Double quote space.
case ' ':
buf.B = append(buf.B, '"', c, '"')
// Escape + double quote.
case '\a':
buf.B = append(buf.B, '"', '\\', 'a', '"')
case '\b':
buf.B = append(buf.B, '"', '\\', 'b', '"')
case '\f':
buf.B = append(buf.B, '"', '\\', 'f', '"')
case '\n':
buf.B = append(buf.B, '"', '\\', 'n', '"')
case '\r':
buf.B = append(buf.B, '"', '\\', 'r', '"')
case '\t':
buf.B = append(buf.B, '"', '\\', 't', '"')
case '\v':
buf.B = append(buf.B, '"', '\\', 'v', '"')
// Append as-is.
default:
buf.B = append(buf.B, c)
}
}
// isQuoted checks if string is single or double quoted. // isQuoted checks if string is single or double quoted.
func isQuoted(str string) bool { func isQuoted(str string) bool {
return (str[0] == '"' && str[len(str)-1] == '"') || return (str[0] == '"' && str[len(str)-1] == '"') ||

2
vendor/modules.txt vendored
View File

@ -40,7 +40,7 @@ codeberg.org/gruf/go-hashenc
# codeberg.org/gruf/go-iotools v0.0.0-20230601182242-d933b07dcbef # codeberg.org/gruf/go-iotools v0.0.0-20230601182242-d933b07dcbef
## explicit; go 1.19 ## explicit; go 1.19
codeberg.org/gruf/go-iotools codeberg.org/gruf/go-iotools
# codeberg.org/gruf/go-kv v1.6.3 # codeberg.org/gruf/go-kv v1.6.4
## explicit; go 1.19 ## explicit; go 1.19
codeberg.org/gruf/go-kv codeberg.org/gruf/go-kv
codeberg.org/gruf/go-kv/format codeberg.org/gruf/go-kv/format