diff --git a/README.md b/README.md index 95d5f4d..7bcaf8d 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ go install github.com/spacetronot-research-team/erago@latest or you can define your prefered version. ```shell -go install github.com/spacetronot-research-team/erago@v0.1.10 +go install github.com/spacetronot-research-team/erago@v0.1.11 ``` Or you can download erago binary from [release page](https://github.com/spacetronot-research-team/erago/releases). diff --git a/internal/repository/templ/controllertest.go b/internal/repository/templ/controllertest.go index 7ed95f9..b304b8e 100644 --- a/internal/repository/templ/controllertest.go +++ b/internal/repository/templ/controllertest.go @@ -23,6 +23,7 @@ func Test{{.DomainPascalCase}}Controller_Qux(t *testing.T) { {{.DomainCamelCase}}Service *mock.Mock{{.DomainPascalCase}} } type args struct { + reqHeader map[string]string reqBody gin.H } tests := []struct { @@ -78,7 +79,11 @@ func Test{{.DomainPascalCase}}Controller_Qux(t *testing.T) { rr := httptest.NewRecorder() ctx, _ := gin.CreateTestContext(rr) reqBody, _ := json.Marshal(tt.args.reqBody) - ctx.Request = httptest.NewRequest(http.MethodGet, "/", bytes.NewReader(reqBody)) + req := httptest.NewRequest(http.MethodGet, "/", bytes.NewReader(reqBody)) + for k, v := range tt.args.reqHeader { + req.Header.Set(k, v) + } + ctx.Request = req {{.DomainShort}}.Qux(ctx) diff --git a/pkg/version/version.go b/pkg/version/version.go index a6beda2..f06cf66 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -1,3 +1,3 @@ package version -const Current = "v0.1.10" +const Current = "v0.1.11"