diff --git a/adaptor/handler.go b/adaptor/handler.go index 5eb64b7..e142932 100644 --- a/adaptor/handler.go +++ b/adaptor/handler.go @@ -90,7 +90,7 @@ func NewHertzHTTPHandlerFunc(h http.HandlerFunc) app.HandlerFunc { // Then manually convert net/http handlers to hertz handlers func NewHertzHTTPHandler(h http.Handler) app.HandlerFunc { return func(ctx context.Context, c *app.RequestContext) { - req, err := adaptor.GetCompatRequest(c.GetRequest()) + req, err := adaptor.GetCompatRequest(&c.Request) if err != nil { hlog.CtxErrorf(ctx, "HERTZ: Get request error: %v", err) c.String(http.StatusInternalServerError, consts.StatusMessage(http.StatusInternalServerError)) diff --git a/adaptor/handler_test.go b/adaptor/handler_test.go index 1421ac9..5c0ff89 100644 --- a/adaptor/handler_test.go +++ b/adaptor/handler_test.go @@ -43,16 +43,23 @@ package adaptor import ( "context" + "fmt" "io/ioutil" "net/http" "net/url" "reflect" + "strings" "testing" + "time" "github.com/cloudwego/hertz/pkg/app" + "github.com/cloudwego/hertz/pkg/app/client" + "github.com/cloudwego/hertz/pkg/common/adaptor" + "github.com/cloudwego/hertz/pkg/common/config" "github.com/cloudwego/hertz/pkg/common/test/assert" "github.com/cloudwego/hertz/pkg/protocol" "github.com/cloudwego/hertz/pkg/protocol/consts" + "github.com/cloudwego/hertz/pkg/route" ) func TestNewHertzHandler(t *testing.T) { @@ -139,3 +146,377 @@ func setContextValueMiddleware(next app.HandlerFunc, key string, value interface next(ctx, c) } } + +func TestConsumingBodyOnNextConn(t *testing.T) { + t.Parallel() + + reqNum := 0 + ch := make(chan *http.Request) + servech := make(chan error, 1) + + opt := config.NewOptions([]config.Option{}) + opt.Addr = "127.0.0.1:10025" + engine := route.NewEngine(opt) + handler := func(res http.ResponseWriter, req *http.Request) { + reqNum++ + ch <- req + } + + hertzHandler := NewHertzHTTPHandler(http.HandlerFunc(handler)) + + engine.POST("/", hertzHandler) + go engine.Run() + defer func() { + engine.Close() + }() + time.Sleep(time.Millisecond * 500) + + c, _ := client.NewClient() + + go func() { + req := protocol.AcquireRequest() + resp := protocol.AcquireResponse() + defer func() { + protocol.ReleaseRequest(req) + protocol.ReleaseResponse(resp) + }() + req.SetRequestURI("http://127.0.0.1:10025") + req.SetMethod("POST") + servech <- c.Do(context.Background(), req, resp) + servech <- c.Do(context.Background(), req, resp) + }() + + var req *http.Request + req = <-ch + if req == nil { + t.Fatal("Got nil first request.") + } + if req.Method != "POST" { + t.Errorf("For request #1's method, got %q; expected %q", + req.Method, "POST") + } + + req = <-ch + if req == nil { + t.Fatal("Got nil first request.") + } + if req.Method != "POST" { + t.Errorf("For request #2's method, got %q; expected %q", + req.Method, "POST") + } + + if serveerr := <-servech; serveerr != nil { + t.Errorf("Serve returned %q; expected EOF", serveerr) + } +} + +func TestCopyToHertzRequest(t *testing.T) { + req := http.Request{ + Method: "GET", + RequestURI: "/test", + URL: &url.URL{ + Scheme: "http", + Host: "test.com", + }, + Proto: "HTTP/1.1", + Header: http.Header{}, + } + req.Header.Set("key1", "value1") + req.Header.Add("key2", "value2") + req.Header.Add("key2", "value22") + hertzReq := protocol.Request{} + err := adaptor.CopyToHertzRequest(&req, &hertzReq) + assert.Nil(t, err) + assert.DeepEqual(t, req.Method, string(hertzReq.Method())) + assert.DeepEqual(t, req.RequestURI, string(hertzReq.Path())) + assert.DeepEqual(t, req.Proto, hertzReq.Header.GetProtocol()) + assert.DeepEqual(t, req.Header.Get("key1"), hertzReq.Header.Get("key1")) + valueSlice := make([]string, 0, 2) + hertzReq.Header.VisitAllCustomHeader(func(key, value []byte) { + if strings.ToLower(string(key)) == "key2" { + valueSlice = append(valueSlice, string(value)) + } + }) + + assert.DeepEqual(t, req.Header.Values("key2"), valueSlice) + + assert.DeepEqual(t, 3, hertzReq.Header.Len()) +} + +func TestParseArgs(t *testing.T) { + t.Parallel() + + opt := config.NewOptions([]config.Option{}) + opt.Addr = "127.0.0.1:10026" + engine := route.NewEngine(opt) + handler := func(resp http.ResponseWriter, req *http.Request) { + queryParams := req.URL.Query() + + paramValue := queryParams.Get("test") + + assert.DeepEqual(t, paramValue, "test_value") + } + + hertzHandler := NewHertzHTTPHandler(http.HandlerFunc(handler)) + + engine.GET("/", hertzHandler) + go engine.Run() + defer func() { + engine.Close() + }() + time.Sleep(time.Millisecond * 500) + + c, _ := client.NewClient() + + req := protocol.AcquireRequest() + resp := protocol.AcquireResponse() + defer func() { + protocol.ReleaseRequest(req) + protocol.ReleaseResponse(resp) + }() + req.SetRequestURI("http://127.0.0.1:10026/?test=test_value") + req.SetMethod("GET") + + err := c.Do(context.Background(), req, resp) + assert.Nil(t, err) +} + +func TestCookies(t *testing.T) { + t.Parallel() + + opt := config.NewOptions([]config.Option{}) + opt.Addr = "127.0.0.1:10027" + engine := route.NewEngine(opt) + handler := func(resp http.ResponseWriter, req *http.Request) { + c, err := req.Cookie("myCookie1") + assert.Nil(t, err) + assert.DeepEqual(t, c.Value, "cookieValue1") + assert.DeepEqual(t, c.HttpOnly, false) + assert.DeepEqual(t, c.Secure, false) + + c, err = req.Cookie("myCookie2") + assert.Nil(t, err) + assert.DeepEqual(t, c.Value, "cookieValue2") + + c.Secure = true + c.HttpOnly = true + c.Domain = "google.com" + c.Expires = time.Now().Add(24 * time.Hour) + http.SetCookie(resp, c) + + assert.DeepEqual(t, c.HttpOnly, true) + assert.DeepEqual(t, c.Secure, true) + assert.DeepEqual(t, c.Domain, "google.com") + assert.NotEqual(t, c.Expires, nil) + } + + hertzHandler := NewHertzHTTPHandler(http.HandlerFunc(handler)) + + engine.GET("/", hertzHandler) + go engine.Run() + defer func() { + engine.Close() + }() + time.Sleep(time.Millisecond * 500) + + c, _ := client.NewClient() + + req := protocol.AcquireRequest() + resp := protocol.AcquireResponse() + defer func() { + protocol.ReleaseRequest(req) + protocol.ReleaseResponse(resp) + }() + req.SetRequestURI("http://127.0.0.1:10027") + req.SetMethod("GET") + req.SetCookie("myCookie1", "cookieValue1") + req.SetCookie("myCookie2", "cookieValue2") + + err := c.Do(context.Background(), req, resp) + assert.Nil(t, err) +} + +func TestHeaders(t *testing.T) { + t.Parallel() + + opt := config.NewOptions([]config.Option{}) + opt.Addr = "127.0.0.1:10028" + engine := route.NewEngine(opt) + handler := func(resp http.ResponseWriter, req *http.Request) { + k := req.Header.Get("key1") + assert.DeepEqual(t, k, "value1") + c := req.Header.Get("cookie") + assert.DeepEqual(t, c, "cookie=cookie_value") + assert.DeepEqual(t, req.Header.Get("Content-Type"), "application/form") + + resp.Header().Add("Content-Encoding", "test") + _, err := resp.Write([]byte("Content-Encoding: test\n")) + if err != nil { + panic(err) + } + } + + hertzHandler := NewHertzHTTPHandler(http.HandlerFunc(handler)) + + engine.GET("/", hertzHandler) + go engine.Run() + defer func() { + engine.Close() + }() + time.Sleep(time.Millisecond * 500) + + c, _ := client.NewClient() + + req := protocol.AcquireRequest() + resp := protocol.AcquireResponse() + defer func() { + protocol.ReleaseRequest(req) + protocol.ReleaseResponse(resp) + }() + req.SetRequestURI("http://127.0.0.1:10028") + req.SetMethod("GET") + req.Header.Set("key1", "value1") + req.Header.SetCookie("cookie", "cookie_value") + req.Header.SetMethod("GET") + req.Header.SetContentTypeBytes([]byte("application/form")) + + err := c.Do(context.Background(), req, resp) + assert.Nil(t, err) + + assert.DeepEqual(t, resp.Header.Get("Content-Encoding"), "test") +} + +func TestForm(t *testing.T) { + t.Parallel() + + opt := config.NewOptions([]config.Option{}) + opt.Addr = "127.0.0.1:10029" + engine := route.NewEngine(opt) + handler := func(resp http.ResponseWriter, req *http.Request) { + assert.DeepEqual(t, req.Header.Get("Content-Type"), "application/x-www-form-urlencoded") + err := req.ParseForm() + if err != nil { + return + } + assert.DeepEqual(t, req.FormValue("form_data"), "value") + } + + hertzHandler := NewHertzHTTPHandler(http.HandlerFunc(handler)) + + engine.POST("/", hertzHandler) + go engine.Run() + defer func() { + engine.Close() + }() + time.Sleep(time.Millisecond * 500) + + c, _ := client.NewClient() + + req := protocol.AcquireRequest() + resp := protocol.AcquireResponse() + defer func() { + protocol.ReleaseRequest(req) + protocol.ReleaseResponse(resp) + }() + req.SetRequestURI("http://127.0.0.1:10029") + req.SetMethod("POST") + + req.SetFormData(map[string]string{"form_data": "value"}) + + err := c.Do(context.Background(), req, resp) + assert.Nil(t, err) +} + +func TestMultiForm(t *testing.T) { + t.Parallel() + + opt := config.NewOptions([]config.Option{}) + opt.Addr = "127.0.0.1:10030" + engine := route.NewEngine(opt) + handler := func(resp http.ResponseWriter, req *http.Request) { + assert.NotEqual(t, req.Header.Get("Content-Type"), "application/x-www-form-urlencoded") + err := req.ParseMultipartForm(32 << 20) + if err != nil { + return + } + assert.DeepEqual(t, req.FormValue("multiform_data"), "value") + } + + hertzHandler := NewHertzHTTPHandler(http.HandlerFunc(handler)) + + engine.POST("/", hertzHandler) + go engine.Run() + defer func() { + engine.Close() + }() + time.Sleep(time.Millisecond * 500) + + c, _ := client.NewClient() + + req := protocol.AcquireRequest() + resp := protocol.AcquireResponse() + defer func() { + protocol.ReleaseRequest(req) + protocol.ReleaseResponse(resp) + }() + req.SetRequestURI("http://127.0.0.1:10030") + req.SetMethod("POST") + + req.SetMultipartFormData(map[string]string{"multiform_data": "value"}) + + err := c.Do(context.Background(), req, resp) + assert.Nil(t, err) +} + +func TestFile(t *testing.T) { + t.Parallel() + + opt := config.NewOptions([]config.Option{}) + opt.Addr = "127.0.0.1:10031" + engine := route.NewEngine(opt) + handler := func(resp http.ResponseWriter, req *http.Request) { + assert.NotEqual(t, req.Header.Get("Content-Type"), "application/x-www-form-urlencoded") + + err := req.ParseForm() + if err != nil { + fmt.Println(err) + panic(err) + } + + file, m, err := req.FormFile("file") + if err != nil { + fmt.Println(err) + panic(err) + } + + assert.DeepEqual(t, m.Filename, "handler.go") + + content, err := ioutil.ReadAll(file) + assert.Nil(t, err) + assert.True(t, len(content) > 0) + } + + hertzHandler := NewHertzHTTPHandler(http.HandlerFunc(handler)) + + engine.POST("/", hertzHandler) + go engine.Run() + defer func() { + engine.Close() + }() + time.Sleep(time.Millisecond * 500) + + c, _ := client.NewClient() + + req := protocol.AcquireRequest() + resp := protocol.AcquireResponse() + defer func() { + protocol.ReleaseRequest(req) + protocol.ReleaseResponse(resp) + }() + req.SetRequestURI("http://127.0.0.1:10031") + req.SetMethod("POST") + req.SetFile("file", "handler.go") + + err := c.Do(context.Background(), req, resp) + assert.Nil(t, err) +} diff --git a/go.mod b/go.mod index 239f9ec..6f99531 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,30 @@ module github.com/hertz-contrib/pprof -go 1.16 +go 1.19 require ( - github.com/cloudwego/hertz v0.3.2 + github.com/cloudwego/hertz v0.8.0 github.com/felixge/fgprof v0.9.3 ) + +require ( + github.com/bytedance/go-tagexpr/v2 v2.9.2 // indirect + github.com/bytedance/gopkg v0.0.0-20220413063733-65bf48ffb3a7 // indirect + github.com/bytedance/sonic v1.8.1 // indirect + github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect + github.com/cloudwego/netpoll v0.5.0 // indirect + github.com/fsnotify/fsnotify v1.5.4 // indirect + github.com/golang/protobuf v1.5.0 // indirect + github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect + github.com/henrylee2cn/ameda v1.4.10 // indirect + github.com/henrylee2cn/goutil v0.0.0-20210127050712-89660552f6f8 // indirect + github.com/klauspost/cpuid/v2 v2.0.9 // indirect + github.com/nyaruka/phonenumbers v1.0.55 // indirect + github.com/tidwall/gjson v1.14.4 // indirect + github.com/tidwall/match v1.1.1 // indirect + github.com/tidwall/pretty v1.2.0 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect + golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect + google.golang.org/protobuf v1.27.1 // indirect +) diff --git a/go.sum b/go.sum index 39cbdde..d1e864e 100644 --- a/go.sum +++ b/go.sum @@ -2,17 +2,21 @@ github.com/bytedance/go-tagexpr/v2 v2.9.2 h1:QySJaAIQgOEDQBLS3x9BxOWrnhqu5sQ+f6H github.com/bytedance/go-tagexpr/v2 v2.9.2/go.mod h1:5qsx05dYOiUXOUgnQ7w3Oz8BYs2qtM/bJokdLb79wRM= github.com/bytedance/gopkg v0.0.0-20220413063733-65bf48ffb3a7 h1:PtwsQyQJGxf8iaPptPNaduEIu9BnrNms+pcRdHAxZaM= github.com/bytedance/gopkg v0.0.0-20220413063733-65bf48ffb3a7/go.mod h1:2ZlV9BaUH4+NXIBF0aMdKKAnHTzqH+iMU4KUjAbL23Q= -github.com/bytedance/sonic v1.3.5 h1:xfBNhsG3QCC+AMCmCHxNQg0StI5IM/B9Jtwjqi5WlI0= -github.com/bytedance/sonic v1.3.5/go.mod h1:V973WhNhGmvHxW6nQmsHEfHaoU9F3zTF+93rH03hcUQ= -github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06 h1:1sDoSuDPWzhkdzNVxCxtIaKiAe96ESVPv8coGwc1gZ4= +github.com/bytedance/mockey v1.2.1 h1:g84ngI88hz1DR4wZTL3yOuqlEcq67MretBfQUdXwrmw= +github.com/bytedance/mockey v1.2.1/go.mod h1:+Jm/fzWZAuhEDrPXVjDf/jLM2BlLXJkwk94zf2JZ3X4= +github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= +github.com/bytedance/sonic v1.8.1 h1:NqAHCaGaTzro0xMmnTCLUyRlbEP6r8MCA1cJUrH3Pu4= +github.com/bytedance/sonic v1.8.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/cloudwego/hertz v0.3.2 h1:YwGmozomDPiJhKfKjKggMUmfNBNHR9iQGVLjY3wJpsY= -github.com/cloudwego/hertz v0.3.2/go.mod h1:hnv3B7eZ6kMv7CKFHT2OC4LU0mA4s5XPyu/SbixLcrU= -github.com/cloudwego/netpoll v0.2.6 h1:vzN8cyayoa9RdCOG87tqkYO/j2hA4SMLC+vkcNUq6uI= -github.com/cloudwego/netpoll v0.2.6/go.mod h1:1T2WVuQ+MQw6h6DpE45MohSvDTKdy2DlzCx2KsnPI4E= +github.com/cloudwego/hertz v0.8.0 h1:rjALfbD/E3IkaNDksQ4oF0nA5d03FfSEx3yc2PkJklo= +github.com/cloudwego/hertz v0.8.0/go.mod h1:WliNtVbwihWHHgAaIQEbVXl0O3aWj0ks1eoPrcEAnjs= +github.com/cloudwego/netpoll v0.5.0 h1:oRrOp58cPCvK2QbMozZNDESvrxQaEHW2dCimmwH1lcU= +github.com/cloudwego/netpoll v0.5.0/go.mod h1:xVefXptcyheopwNDZjDPcfU6kIjZXZ4nY550k1yH9eQ= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -20,62 +24,65 @@ github.com/felixge/fgprof v0.9.3 h1:VvyZxILNuCiUCSXtPtYmmtGvb65nqXh2QFWc0Wpf2/g= github.com/felixge/fgprof v0.9.3/go.mod h1:RdbpDgzqYVh/T9fPELJyV7EYJuHB55UTEULNun8eiPw= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/goccy/go-json v0.9.4 h1:L8MLKG2mvVXiQu07qB6hmfqeSYQdOnqPot2GhsIwIaI= -github.com/goccy/go-json v0.9.4/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20211214055906-6f57359322fd h1:1FjCyPC+syAzJ5/2S8fqdZK1R22vvA0J7JZKcuOIQ7Y= github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/henrylee2cn/ameda v1.4.8/go.mod h1:liZulR8DgHxdK+MEwvZIylGnmcjzQ6N6f2PlWe7nEO4= github.com/henrylee2cn/ameda v1.4.10 h1:JdvI2Ekq7tapdPsuhrc4CaFiqw6QXFvZIULWJgQyCAk= github.com/henrylee2cn/ameda v1.4.10/go.mod h1:liZulR8DgHxdK+MEwvZIylGnmcjzQ6N6f2PlWe7nEO4= github.com/henrylee2cn/goutil v0.0.0-20210127050712-89660552f6f8 h1:yE9ULgp02BhYIrO6sdV/FPe0xQM6fNHkVQW2IAymfM0= github.com/henrylee2cn/goutil v0.0.0-20210127050712-89660552f6f8/go.mod h1:Nhe/DM3671a5udlv2AdV2ni/MZzgfv2qrPL5nIi3EGQ= github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/nyaruka/phonenumbers v1.0.55 h1:bj0nTO88Y68KeUQ/n3Lo2KgK7lM1hF7L9NFuwcCl3yg= github.com/nyaruka/phonenumbers v1.0.55/go.mod h1:sDaTZ/KPX5f8qyV9qN+hIm+4ZBARJrupC6LuhshJq1U= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/tidwall/gjson v1.9.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/gjson v1.13.0 h1:3TFY9yxOQShrvmjdM76K+jc66zJeT6D3/VFFYCGQf7M= -github.com/tidwall/gjson v1.13.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.14.4 h1:uo0p8EbA09J7RQaflQ1aBRffTR7xedD2bcIVSYxLnkM= +github.com/tidwall/gjson v1.14.4/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/tidwall/sjson v1.2.4 h1:cuiLzLnaMeBhRmEv00Lpk3tkYrcxpmbU81tAY4Dw0tc= -github.com/tidwall/sjson v1.2.4/go.mod h1:098SZ494YoMWPmMO6ct4dcFnqxwj9r/gF0Etp19pSNM= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +golang.org/x/arch v0.0.0-20201008161808-52c3e6f60cff/go.mod h1:flIaEI6LNU6xOCD5PaJvn9wGP0agmIOqjrtsKGRguv4= golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VAiXCnxFY6NyDX0bHDmkU= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220110181412-a018aaa089fe/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad h1:ntjMns5wyP/fN65tdBD4g8J5w8n015+iIIs9rtjXkY0= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=