Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to build with go1.23 and above #289

Open
sudhackar opened this issue Feb 21, 2025 · 0 comments
Open

Failure to build with go1.23 and above #289

sudhackar opened this issue Feb 21, 2025 · 0 comments

Comments

@sudhackar
Copy link

sudhackar commented Feb 21, 2025

$ go version && go build
go version go1.24.0 linux/amd64
# github.com/rogpeppe/go-internal/testscript
./exe_go118.go:14:27: cannot use nopTestDeps{} (value of struct type nopTestDeps) as testing.testDeps value in argument to testing.MainStart: nopTestDeps does not implement testing.testDeps (missing method InitRuntimeCoverage)
(staging Source Store)

From https://pkg.go.dev/testing/internal/testdeps

It was added in go1.23.0

Just adding this passes the build

diff --git a/testscript/exe_go123.go b/testscript/exe_go123.go
new file mode 100644
index 0000000..72ececf
--- /dev/null
+++ b/testscript/exe_go123.go
@@ -0,0 +1,8 @@
+//go:build go1.23
+// +build go1.23
+
+package testscript
+
+func (n nopTestDeps) InitRuntimeCoverage() (mode string, tearDown func(coverprofile string, gocoverdir string) (string, error), snapcov func() float64) {
+	return "", nil, nil
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant