logger/unwrap: intergate omit functionality

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2022-11-07 15:56:09 +03:00
parent 5fbb1a923e
commit 59c08c1d9a
2 changed files with 37 additions and 8 deletions

View File

@@ -6,6 +6,19 @@ import (
"go.unistack.org/micro/v3/codec"
)
func TestUnwrapOmit(t *testing.T) {
type val struct {
MP map[string]string `json:"mp" logger:"omit"`
STR string `json:"str"`
AR []string `json:"ar"`
}
v1 := &val{AR: []string{"string1", "string2"}, STR: "string", MP: map[string]string{"key": "val"}}
t.Logf("output: %#v", v1)
t.Logf("output: %#v", Unwrap(v1))
}
func TestUnwrap(t *testing.T) {
string1 := "string1"
string2 := "string2"