Skip to content

Commit

Permalink
cmd/run: fix testing package usage for changes to API in go1.23
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Worm committed Jul 11, 2024
1 parent bebc58f commit 6fbc9d1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion script/runtime/exe_next.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.18
//go:build go1.23

package runtime

Expand Down Expand Up @@ -65,3 +65,7 @@ func runCoverSubcommand(cprof string, mainf func() int) (exitCode int) {
}()
return mainf()
}

func (nopTestDeps) InitRuntimeCoverage() (mode string, tearDown func(string, string) (string, error), snapcov func() float64) {
return
}
4 changes: 2 additions & 2 deletions script/runtime/exe_old.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !go1.18
//go:build !go1.23

package runtime

Expand Down Expand Up @@ -49,7 +49,7 @@ func runCoverSubcommand(cprof string, mainf func() int) (exitCode int) {
// Run MainStart (recursively, but it we should be ok) with no tests
// so that it writes the coverage profile.
// go1.18 -- m := testing.MainStart(nopTestDeps{}, nil, nil, nil, nil)
m := testing.MainStart(nopTestDeps{}, nil, nil, nil)
m := testing.MainStart(nopTestDeps{}, nil, nil, nil, nil)
if code := m.Run(); code != 0 && exitCode == 0 {
exitCode = code
}
Expand Down

0 comments on commit 6fbc9d1

Please sign in to comment.