Skip to content

Not detected if it is inside a test suite #6

@vitorf7

Description

@vitorf7

Thanks for the amazing work on this linter.

I was just using it today and noticed that it was not picking up the usage of context.Background() when using it with a test suite.

For example this would not be caught:

type MyTestSuite struct {
	suite.Suite
	cntr       *cockroachdb.CockroachDBContainer
}

func (c *MyTestSuite) SetupTest() {
	ctx := context.Background() // This line should be detected

	cntr, err := cockroachdb.Run(ctx, "cockroachdb/cockroach:latest-v23.2")
	c.Require().NoError(err)
...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions