Skip to content

Commit

Permalink
use golang 1.21.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ysugimoto committed Apr 27, 2024
1 parent 646517c commit 87f96bb
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
6 changes: 1 addition & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ run:

issues:
exclude-rules:
## Add file patters to exclude linter
## Add file patterns to exclude linter
- path: grpc\/main\.go
linters:
- gomnd
Expand Down Expand Up @@ -132,16 +132,12 @@ linters-settings:
simplify: true
golint:
min-confidence: 0.8
govet:
check-shadowing: true
gomnd:
settings:
mnd:
checks: argument,assign,operation,return
lll:
line-length: 120
maligned:
suggest-new: true
misspell:
locale: US
ignore-words:
Expand Down
12 changes: 10 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,17 @@ require (
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0
github.com/graphql-go/graphql v0.7.8
github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.6.1
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae // indirect
google.golang.org/grpc v1.27.0
google.golang.org/protobuf v1.21.0
)

require (
github.com/davecgh/go-spew v1.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/net v0.0.0-20190311183353-d8887717615a // indirect
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae // indirect
golang.org/x/text v0.3.0 // indirect
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
)
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ github.com/graphql-go/graphql v0.7.8 h1:769CR/2JNAhLG9+aa8pfLkKdR0H+r5lsQqling5W
github.com/graphql-go/graphql v0.7.8/go.mod h1:k6yrAYQaSP59DC5UVxbgxESlmVyojThKdORUqGDGmrI=
github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 h1:VHgatEHNcBFEB7inlalqfNqw65aNkM1lGX2yt3NmbS8=
github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
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/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
Expand Down
6 changes: 3 additions & 3 deletions protoc-gen-graphql/generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"bytes"
"errors"
"fmt"
"io"
"os"
"sort"

"go/format"
"io/ioutil"
"text/template"

// nolint: staticcheck
Expand Down Expand Up @@ -53,7 +53,7 @@ func New(files []*spec.File, args *spec.Params) *Generator {
}
}

w := ioutil.Discard
w := io.Discard
if args.Verbose {
w = os.Stderr
}
Expand Down Expand Up @@ -247,7 +247,7 @@ func (g *Generator) generateFile(file *spec.File, tmpl string, services []*spec.

out, err := format.Source(buf.Bytes())
if err != nil {
ioutil.WriteFile("/tmp/"+root.Name+".go", buf.Bytes(), 0o666) // nolint: gomnd,errcheck
os.WriteFile("/tmp/"+root.Name+".go", buf.Bytes(), 0o666) // nolint: gomnd,errcheck
return nil, err
}

Expand Down
4 changes: 2 additions & 2 deletions runtime/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"

"encoding/json"
"io/ioutil"
"io"
"net/http"

"github.com/iancoleman/strcase"
Expand All @@ -23,7 +23,7 @@ func parseRequest(r *http.Request) (*GraphqlRequest, error) {
// Get request body
switch r.Method {
case http.MethodPost:
buf, err := ioutil.ReadAll(r.Body)
buf, err := io.ReadAll(r.Body)
if err != nil {
return nil, errors.New("malformed request body, " + err.Error())
}
Expand Down

0 comments on commit 87f96bb

Please sign in to comment.