Skip to content

Commit a9dc394

Browse files
committed
refactor doEmpty -> doNamed
1 parent bffe12b commit a9dc394

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

assert/assert.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ func doMKeyExists(key any, a []any) {
762762
// are used to override the auto-generated assert violation message.
763763
func NotEmpty(obj string, a ...any) {
764764
if obj == "" {
765-
doEmpty("string", "not ", a)
765+
doNamed("not", "string", "empty", a)
766766
}
767767
}
768768

@@ -774,15 +774,10 @@ func NotEmpty(obj string, a ...any) {
774774
// are used to override the auto-generated assert violation message.
775775
func Empty(obj string, a ...any) {
776776
if obj != "" {
777-
doEmpty("string", "", a)
777+
doNamed("", "string", "empty", a)
778778
}
779779
}
780780

781-
func doEmpty(tname, notStr string, a []any) {
782-
defMsg := fmt.Sprintf(assertionMsg+": %s should %sbe empty", tname, notStr)
783-
current().reportAssertionFault(1, defMsg, a)
784-
}
785-
786781
// SEmpty asserts that the slice is empty. If it is NOT, it panics/errors
787782
// (according the current Asserter) with the auto-generated message. You can
788783
// append the generated got-want message by using optional message arguments.

0 commit comments

Comments
 (0)