rename data to inputBuf (free up data as variable/type name)

This commit is contained in:
onyx-and-iris 2024-12-29 08:49:51 +00:00
parent 156c1c13e0
commit 0f48ed35ea
5 changed files with 8 additions and 12 deletions

View File

@ -1,8 +1,6 @@
package one package one
import ( import "bytes"
"bytes"
)
func Solve(buf []byte) (int, error) { func Solve(buf []byte) (int, error) {
r := bytes.NewReader(buf) r := bytes.NewReader(buf)

View File

@ -7,9 +7,9 @@ import (
) )
//go:embed testdata/input.txt //go:embed testdata/input.txt
var data []byte var inputBuf []byte
func BenchmarkSolve(b *testing.B) { func BenchmarkSolve(b *testing.B) {
os.Stdout, _ = os.Open(os.DevNull) os.Stdout, _ = os.Open(os.DevNull)
Solve(data) Solve(inputBuf)
} }

View File

@ -1,8 +1,6 @@
package two package two
import ( import "bytes"
"bytes"
)
func Solve(buf []byte) (int, error) { func Solve(buf []byte) (int, error) {
r := bytes.NewReader(buf) r := bytes.NewReader(buf)

View File

@ -7,9 +7,9 @@ import (
) )
//go:embed testdata/input.txt //go:embed testdata/input.txt
var data []byte var inputBuf []byte
func BenchmarkSolve(b *testing.B) { func BenchmarkSolve(b *testing.B) {
os.Stdout, _ = os.Open(os.DevNull) os.Stdout, _ = os.Open(os.DevNull)
Solve(data) Solve(inputBuf)
} }

View File

@ -7,9 +7,9 @@ import (
) )
//go:embed testdata/input.txt //go:embed testdata/input.txt
var data []byte var inputBuf []byte
func BenchmarkSolve(b *testing.B) { func BenchmarkSolve(b *testing.B) {
os.Stdout, _ = os.Open(os.DevNull) os.Stdout, _ = os.Open(os.DevNull)
Solve(data) Solve(inputBuf)
} }