Skip to content

%!(EXTRA in some error messages #1705

@AlekSi

Description

@AlekSi

Description

Some helpers, such as assert.Positive and assert.Negative, pass too many arguments to fmt.Sprintf.

Step To Reproduce

https://go.dev/play/p/zaQ_YqkVZkV?v=gotip

Expected behavior

Goog error messages without %!(EXTRA.

Actual behavior

=== RUN   TestPositiveNegative
    prog_test.go:10: 
        	Error Trace:	/tmp/sandbox2263208710/prog_test.go:10
        	Error:      	"0" is not positive%!(EXTRA int=0)
        	Test:       	TestPositiveNegative
    prog_test.go:11: 
        	Error Trace:	/tmp/sandbox2263208710/prog_test.go:11
        	Error:      	"0" is not negative%!(EXTRA int=0)
        	Test:       	TestPositiveNegative
--- FAIL: TestPositiveNegative (0.00s)
FAIL

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions