Skip to content

Build fails with Go 1.23 because of changed testing.testDeps #391

@stefanb

Description

@stefanb

When trying to build with Go 1.23 rc1 in

It failed at

m := testing.MainStart(nopTestDeps{}, nil, nil, nil, nil)

with error:

  # github.com/hofstadter-io/hof/script/runtime
  script/runtime/exe_next.go:52:26: cannot use nopTestDeps{} (value of type nopTestDeps) as testing.testDeps value in argument to testing.MainStart: nopTestDeps does not implement testing.testDeps (missing method InitRuntimeCoverage)

InitRuntimeCoverage was added by @rsc in:
golang/go@180ea45#diff-36f401ff1ffadb7d7a39cf41c2329615b159fa95cf2e14c1f58d8c46331af429R208

See

Given the NOP nature of nopTestDeps a possible workaround could be to just implement a dummy/nop function InitRuntimeCoverage() in the nopTestDeps:

func (nopTestDeps) InitRuntimeCoverage() (mode string, tearDown func(string, string) (string, error), snapcov func() float64) {
	return
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions