feat: support WithStreamClientInterceptor for zrpc clients (#1907)

* feat: support WithStreamClientInterceptor for zrpc clients

* fix: data race
This commit is contained in:
Kevin Wan
2022-05-14 19:58:17 +08:00
committed by GitHub
parent 95282edb78
commit e80a64fa67
6 changed files with 24 additions and 4 deletions

View File

@@ -462,7 +462,7 @@ func TestStructedLogWithDuration(t *testing.T) {
WithDuration(time.Second).Info(message)
var entry logEntry
if err := json.Unmarshal([]byte(w.builder.String()), &entry); err != nil {
if err := json.Unmarshal([]byte(w.String()), &entry); err != nil {
t.Error(err)
}
assert.Equal(t, levelInfo, entry.Level)
@@ -515,7 +515,7 @@ func TestErrorfWithWrappedError(t *testing.T) {
defer writer.Store(old)
Errorf("hello %w", errors.New(message))
assert.True(t, strings.Contains(w.builder.String(), "hello there"))
assert.True(t, strings.Contains(w.String(), "hello there"))
}
func TestMustNil(t *testing.T) {

View File

@@ -38,7 +38,7 @@ func captureOutput(f func()) string {
f()
SetLevel(prevLevel)
return w.builder.String()
return w.String()
}
func getContent(jsonStr string) string {