Skip to content

Commit 4719b8c

Browse files
authored
Merge pull request Shopify#137 from Shopify/epk/update
Release `1.5.0`
2 parents 5ec268c + b8b49d4 commit 4719b8c

File tree

17 files changed

+93
-83
lines changed

17 files changed

+93
-83
lines changed

Diff for: .github/dockerfile-for-dependabot/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Used for dependabot to detect new golang versions
2-
FROM golang:1.20.5-alpine
2+
FROM golang:1.21.4-alpine

Diff for: .github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
uses: goreleaser/goreleaser-action@5df302e5e9e4c66310a6b6493a8865b12c555af2
3333
with:
3434
distribution: goreleaser
35-
version: v1.18.1
35+
version: v1.22.1
3636
args: release --clean --release-notes=tmp/release_changelog.md
3737
env:
3838
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Diff for: .goreleaser.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
# .goreleaser.yaml
22
builds:
33
- main: ./cmd/ejson/
4+
flags:
5+
- -trimpath
6+
ldflags:
7+
- -s -w -extldflags "-static"
8+
env:
9+
- CGO_ENABLED=0

Diff for: CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 1.5.0
2+
3+
* Bump Go version and update dependencies
4+
* Build static binaries
5+
16
# 1.3.2
27

38
* Bump Go version and update dependencies

Diff for: Makefile

+6-6
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@ build/man/%.gz: man/%.ronn
3434
set -euo pipefail ; $(BUNDLE_EXEC) ronn -r --pipe "$<" | gzip > "$@" || (rm -f "$<" ; false)
3535

3636
build/bin/linux-amd64: $(GOFILES) cmd/$(NAME)/version.go
37-
GOOS=linux GOARCH=amd64 go build -o "$@" "$(PACKAGE)/cmd/$(NAME)"
37+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags '-s -w -extldflags "-static"' -o "$@" "$(PACKAGE)/cmd/$(NAME)"
3838
build/bin/linux-arm64: $(GOFILES) cmd/$(NAME)/version.go
39-
GOOS=linux GOARCH=arm64 go build -o "$@" "$(PACKAGE)/cmd/$(NAME)"
39+
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -trimpath -ldflags '-s -w -extldflags "-static"' -o "$@" "$(PACKAGE)/cmd/$(NAME)"
4040
build/bin/darwin-amd64: $(GOFILES) cmd/$(NAME)/version.go
41-
GOOS=darwin GOARCH=amd64 go build -o "$@" "$(PACKAGE)/cmd/$(NAME)"
41+
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -trimpath -ldflags '-s -w -extldflags "-static"' -o "$@" "$(PACKAGE)/cmd/$(NAME)"
4242
build/bin/darwin-arm64: $(GOFILES) cmd/$(NAME)/version.go
43-
GOOS=darwin GOARCH=arm64 go build -o "$@" "$(PACKAGE)/cmd/$(NAME)"
43+
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -trimpath -ldflags '-s -w -extldflags "-static"' -o "$@" "$(PACKAGE)/cmd/$(NAME)"
4444
build/bin/freebsd-amd64: $(GOFILES) cmd/$(NAME)/version.go
45-
GOOS=freebsd GOARCH=amd64 go build -o "$@" "$(PACKAGE)/cmd/$(NAME)"
45+
CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go build -trimpath -ldflags '-s -w -extldflags "-static"' -o "$@" "$(PACKAGE)/cmd/$(NAME)"
4646
build/bin/windows-amd64.exe: $(GOFILES) cmd/$(NAME)/version.go
47-
GOOS=windows GOARCH=amd64 go build -o "$@" "$(PACKAGE)/cmd/$(NAME)"
47+
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags '-s -w -extldflags "-static"' -o "$@" "$(PACKAGE)/cmd/$(NAME)"
4848

4949
$(GEM): rubygem/$(NAME)-$(VERSION).gem
5050
mkdir -p $(@D)

Diff for: VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.4.1
1+
1.5.0

Diff for: cmd/ejson/actions.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package main
22

33
import (
44
"fmt"
5-
"io/ioutil"
65
"os"
76

87
"github.com/Shopify/ejson"
@@ -52,7 +51,7 @@ func keygenAction(args []string, keydir string, wFlag bool) error {
5251

5352
if wFlag {
5453
keyFile := fmt.Sprintf("%s/%s", keydir, pub)
55-
err := writeFile(keyFile, append([]byte(priv), '\n'), 0440)
54+
err := writeFile(keyFile, append([]byte(priv), '\n'), 0o440)
5655
if err != nil {
5756
return err
5857
}
@@ -65,5 +64,5 @@ func keygenAction(args []string, keydir string, wFlag bool) error {
6564

6665
// for mocking in tests
6766
var (
68-
writeFile = ioutil.WriteFile
67+
writeFile = os.WriteFile
6968
)

Diff for: cmd/ejson/main.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package main
33
import (
44
"fmt"
55
"io"
6-
"io/ioutil"
76
"os"
87
"runtime"
98
"strings"
@@ -26,7 +25,6 @@ func main() {
2625
if runtime.GOOS != "windows" {
2726
// Rather than using the built-in help printer, display the bundled manpages.
2827
cli.HelpPrinter = func(w io.Writer, templ string, data interface{}) {
29-
3028
if cmd, ok := data.(cli.Command); ok {
3129
switch cmd.Name {
3230
case "encrypt", "decrypt", "keygen":
@@ -79,7 +77,7 @@ func main() {
7977
Action: func(c *cli.Context) {
8078
var userSuppliedPrivateKey string
8179
if c.Bool("key-from-stdin") {
82-
stdinContent, err := ioutil.ReadAll(os.Stdin)
80+
stdinContent, err := io.ReadAll(os.Stdin)
8381
if err != nil {
8482
fmt.Fprintln(os.Stderr, "Failed to read from stdin:", err)
8583
os.Exit(1)

Diff for: cmd/ejson/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
package main
22

3-
const VERSION string = "1.4.1"
3+
const VERSION string = "1.5.0"

Diff for: crypto/boxed_message.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ var messageParser = regexp.MustCompile("\\AEJ\\[(\\d):([A-Za-z0-9+=/]{44}):([A-Z
1212
// boxedMessage dumps and loads the wire format for encrypted messages. The
1313
// schema is fairly simple:
1414
//
15-
// "EJ["
16-
// SchemaVersion ( "1" )
17-
// ":"
18-
// EncrypterPublic :: base64-encoded 32-byte key
19-
// ":"
20-
// Nonce :: base64-encoded 24-byte nonce
21-
// ":"
22-
// Box :: base64-encoded encrypted message
23-
// "]"
15+
// "EJ["
16+
// SchemaVersion ( "1" )
17+
// ":"
18+
// EncrypterPublic :: base64-encoded 32-byte key
19+
// ":"
20+
// Nonce :: base64-encoded 24-byte nonce
21+
// ":"
22+
// Box :: base64-encoded encrypted message
23+
// "]"
2424
type boxedMessage struct {
2525
SchemaVersion int
2626
EncrypterPublic [32]byte

Diff for: dev.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ up:
55
- gnu-tar
66
- ruby: 3.0.3
77
- go:
8-
version: '1.20'
8+
version: '1.21.4'
99
- bundler
1010

1111
commands:

Diff for: ejson.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"encoding/hex"
99
"fmt"
1010
"io"
11-
"io/ioutil"
1211
"os"
1312
"strings"
1413

@@ -33,7 +32,7 @@ func GenerateKeypair() (pub string, priv string, err error) {
3332
// Returns the number of bytes written and any error that might have
3433
// occurred.
3534
func Encrypt(in io.Reader, out io.Writer) (int, error) {
36-
data, err := ioutil.ReadAll(in)
35+
data, err := io.ReadAll(in)
3736
if err != nil {
3837
return -1, err
3938
}
@@ -95,7 +94,7 @@ func EncryptFileInPlace(filePath string) (int, error) {
9594
return -1, err
9695
}
9796

98-
if err := ioutil.WriteFile(filePath, outBuffer.Bytes(), fileMode); err != nil {
97+
if err := os.WriteFile(filePath, outBuffer.Bytes(), fileMode); err != nil {
9998
return -1, err
10099
}
101100

@@ -106,7 +105,7 @@ func EncryptFileInPlace(filePath string) (int, error) {
106105
// The private key is expected to be under 'keydir'.
107106
// Returns error upon failure, or nil on success.
108107
func Decrypt(in io.Reader, out io.Writer, keydir string, userSuppliedPrivateKey string) error {
109-
data, err := ioutil.ReadAll(in)
108+
data, err := io.ReadAll(in)
110109
if err != nil {
111110
return err
112111
}
@@ -168,7 +167,7 @@ func DecryptFile(filePath, keydir string, userSuppliedPrivateKey string) ([]byte
168167
func readPrivateKeyFromDisk(pubkey [32]byte, keydir string) (privkey string, err error) {
169168
keyFile := fmt.Sprintf("%s/%x", keydir, pubkey)
170169
var fileContents []byte
171-
fileContents, err = ioutil.ReadFile(keyFile)
170+
fileContents, err = os.ReadFile(keyFile)
172171
if err != nil {
173172
err = fmt.Errorf("couldn't read key file (%s)", err.Error())
174173
return

Diff for: ejson_test.go

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package ejson
22

33
import (
4-
"io/ioutil"
54
"os"
65
"path"
76
"regexp"
@@ -31,7 +30,7 @@ func TestGenerateKeypair(t *testing.T) {
3130
}
3231

3332
func setData(path string, data []byte) error {
34-
tmpFile, err := os.OpenFile(path, os.O_TRUNC|os.O_WRONLY, 0600)
33+
tmpFile, err := os.OpenFile(path, os.O_TRUNC|os.O_WRONLY, 0o600)
3534
if err != nil {
3635
return err
3736
}
@@ -43,13 +42,13 @@ func setData(path string, data []byte) error {
4342
}
4443

4544
func TestEncryptFileInPlace(t *testing.T) {
46-
tempDir, err := ioutil.TempDir("", "ejson_keys")
45+
tempDir, err := os.MkdirTemp("", "ejson_keys")
4746
if err != nil {
4847
t.Fatal(err)
4948
}
5049
defer os.RemoveAll(tempDir)
5150

52-
tempFile, err := ioutil.TempFile(tempDir, "ejson_test")
51+
tempFile, err := os.CreateTemp(tempDir, "ejson_test")
5352
if err != nil {
5453
t.Fatal(err)
5554
}
@@ -86,7 +85,8 @@ func TestEncryptFileInPlace(t *testing.T) {
8685
setData(tempFileName, []byte(`{"_public_key": "`+validPubKey+`", "a": "b"}`))
8786

8887
_, err := EncryptFileInPlace(tempFileName)
89-
output, err := ioutil.ReadFile(tempFileName)
88+
So(err, ShouldBeNil)
89+
output, err := os.ReadFile(tempFileName)
9090
So(err, ShouldBeNil)
9191
Convey("should encrypt the file", func() {
9292
So(err, ShouldBeNil)
@@ -99,33 +99,33 @@ func TestEncryptFileInPlace(t *testing.T) {
9999
setData(tempFileName, []byte(`{"_public_key": "`+validPubKey+"\", \"a\": \"b\nc\"\n}"))
100100

101101
_, err := EncryptFileInPlace(tempFileName)
102-
output, err := ioutil.ReadFile(tempFileName)
102+
So(err, ShouldBeNil)
103+
output, err := os.ReadFile(tempFileName)
103104
So(err, ShouldBeNil)
104105
Convey("should encrypt the file", func() {
105106
So(err, ShouldBeNil)
106-
match := regexp.MustCompile(`{"_public_key": "8d8.*", "a": "EJ.*"`+"\n}")
107+
match := regexp.MustCompile(`{"_public_key": "8d8.*", "a": "EJ.*"` + "\n}")
107108
So(match.Find(output), ShouldNotBeNil)
108109
})
109110
})
110-
111111
})
112112
}
113113

114114
func TestDecryptFile(t *testing.T) {
115-
tempDir, err := ioutil.TempDir("", "ejson_keys")
115+
tempDir, err := os.MkdirTemp("", "ejson_keys")
116116
if err != nil {
117117
t.Fatal(err)
118118
}
119119
defer os.RemoveAll(tempDir)
120120

121-
tempFile, err := ioutil.TempFile(tempDir, "ejson_test")
121+
tempFile, err := os.CreateTemp(tempDir, "ejson_test")
122122
if err != nil {
123123
t.Fatal(err)
124124
}
125125
tempFile.Close()
126126
tempFileName := tempFile.Name()
127127
validKeyPath := path.Join(tempDir, validPubKey)
128-
if err = ioutil.WriteFile(validKeyPath, []byte(validPrivKey), 0600); err != nil {
128+
if err = os.WriteFile(validKeyPath, []byte(validPrivKey), 0o600); err != nil {
129129
t.Fatal(err)
130130
}
131131

Diff for: go.mod

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
module github.com/Shopify/ejson
22

3-
go 1.18
3+
go 1.21.4
44

55
require (
66
github.com/dustin/gojson v0.0.0-20160307161227-2e71ec9dd5ad
7-
github.com/smartystreets/goconvey v1.6.4
8-
github.com/urfave/cli v1.22.4
9-
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4
7+
github.com/smartystreets/goconvey v1.8.1
8+
github.com/urfave/cli v1.22.14
9+
golang.org/x/crypto v0.15.0
1010
)
1111

1212
require (
13-
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
14-
github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 // indirect
13+
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
14+
github.com/gopherjs/gopherjs v1.17.2 // indirect
1515
github.com/jtolds/gls v4.20.0+incompatible // indirect
16-
github.com/russross/blackfriday/v2 v2.0.1 // indirect
17-
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
18-
github.com/smartystreets/assertions v1.0.1 // indirect
19-
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect
16+
github.com/russross/blackfriday/v2 v2.1.0 // indirect
17+
github.com/smarty/assertions v1.15.0 // indirect
18+
golang.org/x/sys v0.14.0 // indirect
2019
)

Diff for: go.sum

+32-28
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,39 @@
1-
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
2-
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
3-
github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM=
4-
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
1+
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
2+
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
3+
github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM=
4+
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
5+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
6+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
7+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
58
github.com/dustin/gojson v0.0.0-20160307161227-2e71ec9dd5ad h1:Qk76DOWdOp+GlyDKBAG3Klr9cn7N+LcYc82AZ2S7+cA=
69
github.com/dustin/gojson v0.0.0-20160307161227-2e71ec9dd5ad/go.mod h1:mPKfmRa823oBIgl2r20LeMSpTAteW5j7FLkc0vjmzyQ=
7-
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
8-
github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 h1:l5lAOZEym3oK3SQ2HBHWsJUfbNBiTXJDeW2QDxw9AQ0=
9-
github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
10+
github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g=
11+
github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k=
1012
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
1113
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
1214
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
1315
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
14-
github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
15-
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
16-
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
17-
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
18-
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
19-
github.com/smartystreets/assertions v1.0.1 h1:voD4ITNjPL5jjBfgR/r8fPIIBrliWrWHeiJApdr3r4w=
20-
github.com/smartystreets/assertions v1.0.1/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM=
21-
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
22-
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
23-
github.com/urfave/cli v1.22.4 h1:u7tSpNPPswAFymm8IehJhy4uJMlUuU/GmqSkvJ1InXA=
24-
github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
25-
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
26-
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 h1:kUhD7nTDoI3fVd9G4ORWrbV5NY0liEs/Jg2pv5f+bBA=
27-
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
28-
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
29-
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
30-
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad h1:ntjMns5wyP/fN65tdBD4g8J5w8n015+iIIs9rtjXkY0=
31-
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
32-
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
33-
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
16+
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
17+
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
18+
github.com/smarty/assertions v1.15.0 h1:cR//PqUBUiQRakZWqBiFFQ9wb8emQGDb0HeGdqGByCY=
19+
github.com/smarty/assertions v1.15.0/go.mod h1:yABtdzeQs6l1brC900WlRNwj6ZR55d7B+E8C6HtKdec=
20+
github.com/smartystreets/goconvey v1.8.1 h1:qGjIddxOk4grTu9JPOU31tVfq3cNdBlNa5sSznIX1xY=
21+
github.com/smartystreets/goconvey v1.8.1/go.mod h1:+/u4qLyY6x1jReYOp7GOM2FSt8aP9CzCZL03bI28W60=
22+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
23+
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
24+
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
25+
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
26+
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
27+
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
28+
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
29+
github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk=
30+
github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA=
31+
golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA=
32+
golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g=
33+
golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
34+
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
3435
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
35-
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
36+
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
37+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
38+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
39+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

Diff for: json/walker.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ func CollapseMultilineStringLiterals(data []byte) ([]byte, error) {
5151
if inString && c == '\n' {
5252
buf = append(buf, []byte{'\\', 'n'}...)
5353
continue
54-
} else if inString && c == '\r' {
54+
} else if inString && c == '\r' {
5555
buf = append(buf, []byte{'\\', 'r'}...)
5656
continue
57-
}
57+
}
5858
buf = append(buf, c)
5959
switch v := scanner.Step(&scanner, int(c)); v {
6060
case json.ScanContinue:

Diff for: json/walker_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ var walkTestCases = []testCase{
5252

5353
var collapseTestCases = []testCase{
5454
{
55-
"{\"a\": \"b\r\nc\nd\"\r\n}",
55+
"{\"a\": \"b\r\nc\nd\"\r\n}",
5656
"{\"a\": \"b\\r\\nc\\nd\"\r\n}",
5757
},
5858
}

0 commit comments

Comments
 (0)