diff --git a/plugins/zltx/internal/zltx_test.go b/plugins/zltx/internal/zltx_test.go index fa3e805..b4952b5 100644 --- a/plugins/zltx/internal/zltx_test.go +++ b/plugins/zltx/internal/zltx_test.go @@ -71,8 +71,7 @@ func TestQuery(t *testing.T) { fmt.Println("order: not found in the string") return } - trimmedResult := requestString[index+len("order:"):] - fmt.Println(trimmedResult) + fmt.Println(requestString[index+len("order:"):]) t.Run("TestQuery", func(t *testing.T) { got, err := zltx.Query(context.Background(), request) @@ -82,16 +81,12 @@ func TestQuery(t *testing.T) { } result := got.String() fmt.Printf("%+v \n", got) - fmt.Printf("%s \n", got.Result.String()) - - index := strings.Index(result, "result:") + index = strings.Index(result, "result:") if index == -1 { fmt.Println("result: not found in the string") return } - // 截取 result: 后面的部分 - trimmedResult := result[index+len("result:"):] - fmt.Println(trimmedResult) + fmt.Println(result[index+len("result:"):]) assert.Equal(t, int(proto.Status_SUCCESS), int(got.Result.Status)) })