diff --git a/bench_test.go b/bench_test.go index 9fa5d64..15898cd 100644 --- a/bench_test.go +++ b/bench_test.go @@ -4,11 +4,10 @@ import ( "bytes" "compress/gzip" "encoding/json" - "fmt" "io" - "io/ioutil" "os" "path/filepath" + "strconv" "strings" "testing" ) @@ -69,7 +68,7 @@ func BenchmarkBufferSize(b *testing.B) { b.Run(tc.path, func(b *testing.B) { for _, sz := range sizes { buf := make([]byte, sz) - b.Run(fmt.Sprint(sz), func(b *testing.B) { + b.Run(strconv.Itoa(sz), func(b *testing.B) { b.ReportAllocs() b.SetBytes(r.Size()) b.ResetTimer() @@ -257,7 +256,7 @@ func fixture(tb testing.TB, path string) *bytes.Reader { defer f.Close() gz, err := gzip.NewReader(f) check(tb, err) - buf, err := ioutil.ReadAll(gz) + buf, err := io.ReadAll(gz) check(tb, err) return bytes.NewReader(buf) } diff --git a/decoder.go b/decoder.go index 1607e39..5c033b1 100644 --- a/decoder.go +++ b/decoder.go @@ -64,7 +64,7 @@ func (s *stack) len() int { return len(*s) } // to mark the start and end of arrays and objects. // Commas and colons are elided. // -// Note: this API is provided for compatability with the encoding/json +// Note: this API is provided for compatibility with the encoding/json // package and carries a significant allocation cost. See NextToken for // a more efficient API. func (d *Decoder) Token() (json.Token, error) { diff --git a/scanner.go b/scanner.go index 2a95289..e57cedd 100644 --- a/scanner.go +++ b/scanner.go @@ -43,7 +43,7 @@ var whitespace = [256]bool{ // Next returns a []byte referencing the the next lexical token in the stream. // The []byte is valid until Next is called again. -// If the stream is at its end, or an error has occured, Next returns a zero +// If the stream is at its end, or an error has occurred, Next returns a zero // length []byte slice. // // A valid token begins with one of the following: