mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-13 18:00:00 +08:00
chore: refactor set in collection package (#5016)
This commit is contained in:
@@ -88,7 +88,7 @@ func TestLogDuration(t *testing.T) {
|
||||
|
||||
assert.NotPanics(t, func() {
|
||||
logDuration(test.ctx, "foo", test.req, test.duration,
|
||||
collection.NewSet(), test.durationThreshold)
|
||||
collection.NewSet[string](), test.durationThreshold)
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -150,7 +150,7 @@ func TestLogDurationWithoutContent(t *testing.T) {
|
||||
|
||||
assert.NotPanics(t, func() {
|
||||
logDuration(test.ctx, "foo", test.req, test.duration,
|
||||
collection.NewSet(), test.durationThreshold)
|
||||
collection.NewSet[string](), test.durationThreshold)
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -206,9 +206,10 @@ func Test_shouldLogContent(t *testing.T) {
|
||||
t.Cleanup(func() {
|
||||
ignoreContentMethods = sync.Map{}
|
||||
})
|
||||
set := collection.NewSet()
|
||||
set.AddStr(tt.args.staticNotLoggingContentMethods...)
|
||||
assert.Equalf(t, tt.want, shouldLogContent(tt.args.method, set), "shouldLogContent(%v, %v)", tt.args.method, tt.args.staticNotLoggingContentMethods)
|
||||
set := collection.NewSet[string]()
|
||||
set.Add(tt.args.staticNotLoggingContentMethods...)
|
||||
assert.Equalf(t, tt.want, shouldLogContent(tt.args.method, set),
|
||||
"shouldLogContent(%v, %v)", tt.args.method, tt.args.staticNotLoggingContentMethods)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user