Skip to content

Commit 48978ed

Browse files
committed
chore: Use go tool
1 parent 85dcf43 commit 48978ed

File tree

5 files changed

+29
-19
lines changed

5 files changed

+29
-19
lines changed

Makefile

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fmt:
3333
@!(gofmt -l -s -d ${GOFILES} | grep '[a-z]')
3434

3535
@echo "Verifying goimports, failures can be fixed with ./scripts/fix.sh"
36-
@!(go run golang.org/x/tools/cmd/goimports@latest -l -d ${GOFILES} | grep '[a-z]')
36+
@!(go tool golang.org/x/tools/cmd/goimports -l -d ${GOFILES} | grep '[a-z]')
3737

3838
.PHONY: lint
3939
lint:
@@ -71,16 +71,12 @@ clean: # Clean binaries
7171
rm -f ./bin/${BOLT_CMD}
7272

7373
.PHONY: gofail-enable
74-
gofail-enable: install-gofail
75-
gofail enable .
74+
gofail-enable:
75+
go tool go.etcd.io/gofail enable .
7676

7777
.PHONY: gofail-disable
78-
gofail-disable: install-gofail
79-
gofail disable .
80-
81-
.PHONY: install-gofail
82-
install-gofail:
83-
go install go.etcd.io/gofail
78+
gofail-disable:
79+
go tool go.etcd.io/gofail disable .
8480

8581
.PHONY: test-failpoint
8682
test-failpoint:
@@ -99,10 +95,6 @@ test-robustness: gofail-enable build
9995
.PHONY: test-benchmark-compare
10096
# Runs benchmark tests on the current git ref and the given REF, and compares
10197
# the two.
102-
test-benchmark-compare: install-benchstat
98+
test-benchmark-compare:
10399
@git fetch
104100
./scripts/compare_benchmarks.sh $(REF)
105-
106-
.PHONY: install-benchstat
107-
install-benchstat:
108-
go install golang.org/x/perf/cmd/benchstat@latest

go.mod

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module go.etcd.io/bbolt
22

3-
go 1.24
3+
go 1.24.0
44

55
toolchain go1.24.6
66

@@ -14,8 +14,18 @@ require (
1414
)
1515

1616
require (
17+
github.com/aclements/go-moremath v0.0.0-20210112150236-f10218a38794 // indirect
1718
github.com/davecgh/go-spew v1.1.1 // indirect
1819
github.com/inconshreveable/mousetrap v1.1.0 // indirect
1920
github.com/pmezard/go-difflib v1.0.0 // indirect
21+
golang.org/x/mod v0.27.0 // indirect
22+
golang.org/x/perf v0.0.0-20250813145418-2f7363a06fe1 // indirect
23+
golang.org/x/tools v0.36.0 // indirect
2024
gopkg.in/yaml.v3 v3.0.1 // indirect
2125
)
26+
27+
tool (
28+
go.etcd.io/gofail
29+
golang.org/x/perf/cmd/benchstat
30+
golang.org/x/tools/cmd/goimports
31+
)

go.sum

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
github.com/aclements/go-moremath v0.0.0-20210112150236-f10218a38794 h1:xlwdaKcTNVW4PtpQb8aKA4Pjy0CdJHEqvFbAnvR5m2g=
2+
github.com/aclements/go-moremath v0.0.0-20210112150236-f10218a38794/go.mod h1:7e+I0LQFUI9AXWxOfsQROs9xPhoJtbsyWcjJqDd4KPY=
13
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
24
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
35
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -15,10 +17,16 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf
1517
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
1618
go.etcd.io/gofail v0.2.0 h1:p19drv16FKK345a09a1iubchlw/vmRuksmRzgBIGjcA=
1719
go.etcd.io/gofail v0.2.0/go.mod h1:nL3ILMGfkXTekKI3clMBNazKnjUZjYLKmBHzsVAnC1o=
20+
golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ=
21+
golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc=
22+
golang.org/x/perf v0.0.0-20250813145418-2f7363a06fe1 h1:stGRioFgvBd3x8HoGVg9bb41lLTWLjBMFT/dMB7f4mQ=
23+
golang.org/x/perf v0.0.0-20250813145418-2f7363a06fe1/go.mod h1:rjfRjhHXb3XNVh/9i5Jr2tXoTd0vOlZN5rzsM8cQE6k=
1824
golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
1925
golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
2026
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
2127
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
28+
golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg=
29+
golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s=
2230
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
2331
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
2432
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

scripts/compare_benchmarks.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ function main() {
5757
echo "BASE=${BASE_TO_COMPARE} HEAD=${REF_CURRENT}"
5858

5959
if [[ "${BENCHSTAT_FORMAT}" == "csv" ]]; then
60-
benchstat -format=csv -confidence="${BENCHSTAT_CONFIDENCE_LEVEL}" BASE="${RESULT_TO_COMPARE}" HEAD="${RESULT_CURRENT}" 2>/dev/null 1>"${BENCHSTAT_OUTPUT_FILE}"
60+
go tool golang.org/x/perf/cmd/benchstat -format=csv -confidence="${BENCHSTAT_CONFIDENCE_LEVEL}" BASE="${RESULT_TO_COMPARE}" HEAD="${RESULT_CURRENT}" 2>/dev/null 1>"${BENCHSTAT_OUTPUT_FILE}"
6161
else
6262
if [[ -z "${BENCHSTAT_OUTPUT_FILE}" ]]; then
63-
benchstat -confidence="${BENCHSTAT_CONFIDENCE_LEVEL}" BASE="${RESULT_TO_COMPARE}" HEAD="${RESULT_CURRENT}"
63+
go tool golang.org/x/perf/cmd/benchstat -confidence="${BENCHSTAT_CONFIDENCE_LEVEL}" BASE="${RESULT_TO_COMPARE}" HEAD="${RESULT_CURRENT}"
6464
else
65-
benchstat -confidence="${BENCHSTAT_CONFIDENCE_LEVEL}" BASE="${RESULT_TO_COMPARE}" HEAD="${RESULT_CURRENT}" 1>"${BENCHSTAT_OUTPUT_FILE}"
65+
go tool golang.org/x/perf/cmd/benchstat -confidence="${BENCHSTAT_CONFIDENCE_LEVEL}" BASE="${RESULT_TO_COMPARE}" HEAD="${RESULT_CURRENT}" 1>"${BENCHSTAT_OUTPUT_FILE}"
6666
fi
6767
fi
6868
}

scripts/fix.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ TESTGOFILES=$(${GO_CMD} list --f "{{with \$d:=.}}{{range .TestGoFiles}}{{\$d.Di
77
XTESTGOFILES=$(${GO_CMD} list --f "{{with \$d:=.}}{{range .XTestGoFiles}}{{\$d.Dir}}/{{.}}{{\"\n\"}}{{end}}{{end}}" ./...)
88

99

10-
echo "${GOFILES}" "${TESTGOFILES}" "${XTESTGOFILES}"| xargs -n 100 go run golang.org/x/tools/cmd/goimports@latest -w -local go.etcd.io
10+
echo "${GOFILES}" "${TESTGOFILES}" "${XTESTGOFILES}"| xargs -n 100 go tool golang.org/x/tools/cmd/goimports -w -local go.etcd.io
1111

1212
go fmt ./...
1313
go mod tidy

0 commit comments

Comments
 (0)