Skip to content

Replace fmt.Println/Printf with t.Log/Logf #8

@alexandear

Description

@alexandear

I propose adding a new option fmt-print that detects fmt.Println/fmt.Printf calls in tests.

The check should suggest replacing fmt.Println with t/b.Log, fmt.Printf wtih t/b.Logf.

Real examples

github.com/99designs/gqlgen

In the TestApolloTracing fmt.Printf could be replaced with t.Logf. See 99designs/gqlgen#3099

github.com/hypermodeinc/badger

In the TestExistsMore fmt.Println could by replaced with t.Log.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions