Skip to content

assert: fix interpolation using %s instead of %#v for interfaces#1112

Open
effeix wants to merge 1 commit intostretchr:masterfrom
effeix:fix-log-message-interface
Open

assert: fix interpolation using %s instead of %#v for interfaces#1112
effeix wants to merge 1 commit intostretchr:masterfrom
effeix:fix-log-message-interface

Conversation

@effeix
Copy link

@effeix effeix commented Sep 2, 2021

Summary

Fix string interpolation issues using %s instead of %#v

Changes

Switch %s with %#v inside error messages in func Len()
use err.Error() instead of only err to log the error message in func NotEqual()
Switch %s with %#v inside error messages in func NotContains()
Switch %s with %#v inside error messages in func Subset()
Switch %s with %#v inside error messages in func NotSubset()

Motivation

The error messages were not clear on what was happening because the element is not being formatted correctly.

@dolmen
Copy link
Collaborator

dolmen commented Jun 2, 2025

@effeix Please rebase and fix conflicts.

@dolmen dolmen added assert.Len pkg-assert Change related to package testify/assert enhancement: output format Enhancement related to formatting of messages labels Jun 2, 2025
@dolmen dolmen changed the title Fix interpolation using %s instead of %#v for interfaces assert: fix interpolation using %s instead of %#v for interfaces Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

assert.Len enhancement: output format Enhancement related to formatting of messages must-rebase pkg-assert Change related to package testify/assert

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants