Open2

gqlgen tips

gqlgen cmdでエラーになる

$go run github.com/99designs/gqlgen generate
../../../go/pkg/mod/github.com/99designs/gqlgen@v0.14.0/internal/code/packages.go:8:2: missing go.sum entry for module providing package github.com/pkg/errors (imported by github.com/99designs/gqlgen/cmd); to add:
	go get github.com/99designs/gqlgen/cmd@v0.14.0
../../../go/pkg/mod/github.com/99designs/gqlgen@v0.14.0/cmd/gen.go:9:2: missing go.sum entry for module providing package github.com/urfave/cli/v2 (imported by github.com/99designs/gqlgen/cmd); to add:
	go get github.com/99designs/gqlgen/cmd@v0.14.0
../../../go/pkg/mod/github.com/99designs/gqlgen@v0.14.0/internal/imports/prune.go:15:2: missing go.sum entry for module providing package golang.org/x/tools/go/ast/astutil (imported by github.com/99designs/gqlgen/internal/imports); to add:
	go get github.com/99designs/gqlgen/internal/imports@v0.14.0
../../../go/pkg/mod/github.com/99designs/gqlgen@v0.14.0/internal/code/packages.go:9:2: missing go.sum entry for module providing package golang.org/x/tools/go/packages (imported by github.com/99designs/gqlgen/internal/code); to add:
	go get github.com/99designs/gqlgen/internal/code@v0.14.0
../../../go/pkg/mod/github.com/99designs/gqlgen@v0.14.0/internal/imports/prune.go:16:2: missing go.sum entry for module providing package golang.org/x/tools/imports (imported by github.com/99designs/gqlgen/internal/imports); to add:
	go get github.com/99designs/gqlgen/internal/imports@v0.14.0v
printf '// +build tools\npackage tools\nimport _ "github.com/99designs/gqlgen"' | gofmt > tools.go
go mod tidy
ログインするとコメントできます