Skip to content

Commit

Permalink
Merge pull request #186 from Yamashou/update-gqlgen
Browse files Browse the repository at this point in the history
Update gqlgen
  • Loading branch information
Yamashou authored Sep 19, 2023
2 parents 3ed234b + dee2cb7 commit 308e653
Show file tree
Hide file tree
Showing 13 changed files with 5,045 additions and 2,939 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.19
go-version: ^1.21
id: go

- name: Check out code into the Go module directory
Expand All @@ -31,7 +31,7 @@ jobs:
fi
- name: Install Lint
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.49.0
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.54.2

- name: Lint
run: make lint
Expand Down
13 changes: 9 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ linters:
- structcheck
- exhaustruct
- nonamedreturns
- golint
- ifshort
- nosnakecase
- deadcode
- scopelint
- varcheck
- depguard
- musttag
- paralleltest
fast: false

issues:
Expand Down Expand Up @@ -85,10 +94,6 @@ issues:
text: "append to slice `frontier` with non-zero initialized length" # used in config/config.go
linters:
- makezero
- path: clientv2/client_test.go
text: "should not use basic type string as key in context.WithValue"
linters:
- golint
- path: clientv2/client_test.go
text: "should not use built-in type string as key for value; define your own type to avoid collisions"
linters:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MAKEFLAGS=--no-builtin-rules --no-builtin-variables --always-make

fmt:
gofumports -local github.com/Yamashou/gqlgenc -w .
goimports -local github.com/Yamashou/gqlgenc -w . && gofumpt -extra -w . && gci write -s Standard -s Default .

lint:
golangci-lint cache clean && golangci-lint run
Expand Down
1 change: 0 additions & 1 deletion clientgenv2/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (

"github.com/99designs/gqlgen/codegen/config"
"github.com/99designs/gqlgen/plugin"

gqlgencConfig "github.com/Yamashou/gqlgenc/config"
)

Expand Down
2 changes: 0 additions & 2 deletions clientgenv2/template.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package clientgenv2

import (

// nolint:golint, nolintlint
"bytes"
_ "embed" // used to load template file
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion clientv2/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ func TestChainInterceptor(t *testing.T) {
require.Equal(t, someValue, val, msg...)
}

req, err := http.NewRequestWithContext(parentContext, http.MethodPost, "https://hogehoge/graphql", bytes.NewBuffer([]byte(requestMessage)))
req, err := http.NewRequestWithContext(parentContext, http.MethodPost, "https://hogehoge/graphql", bytes.NewBufferString(requestMessage))
require.Nil(t, err)

first := func(ctx context.Context, req *http.Request, gqlInfo *GQLRequestInfo, res interface{}, next RequestInterceptorFunc) error {
Expand Down
11 changes: 11 additions & 0 deletions example/annict/gen/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions example/files-info/gen/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 308e653

Please sign in to comment.