Skip to content

Build error: cannot use t (variable of type *codspeed.T) as *testing.T value #28

@marten-seemann

Description

@marten-seemann

I'm working on enabling Codspeed for quic-go, but the job is failing due to a compilation error:

  [INFO  codspeed_go_runner] Building binary for package: quic
  [WARN  codspeed_go_runner::builder] Build command output: 
  [WARN  codspeed_go_runner::builder] Build command error output: # github.com/quic-go/quic-go/internal/synctest
  Error:     internal/synctest/synctest_go125.go:11:16: cannot use t (variable of type *codspeed.T) as *"testing".T value in argument to synctest.Test
  Error:     internal/synctest/synctest_go125.go:11:19: cannot use f (variable of type func(t *codspeed.T)) as func(*"testing".T) value in argument to synctest.Test

Here's my theory (without having done a lot of research): It looks like Codspeed is replacing testing.T with codspeed.T, and this doesn't work in this case. As I'm passing around testing.T a lot, I assume that the problem only occurs when testing.T is passed to a function across package boundaries.

Is my suspicion correct? What can I do to properly build my code?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions