Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The quickstart tutorial is not working #2641

Closed
hirikarate opened this issue May 20, 2023 · 2 comments
Closed

The quickstart tutorial is not working #2641

hirikarate opened this issue May 20, 2023 · 2 comments

Comments

@hirikarate
Copy link

What happened?

I'm following the guide in Getting Started page. This is the error when I execute go run github.com/99designs/gqlgen init:

$ go run github.com/99designs/gqlgen init
# github.com/urfave/cli/v2
C:\Users\MyName\go\pkg\mod\github.com\urfave\cli\v2@v2.24.4\sliceflag.go:15:12: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
C:\Users\MyName\go\pkg\mod\github.com\urfave\cli\v2@v2.24.4\sliceflag.go:15:29: type instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
C:\Users\MyName\go\pkg\mod\github.com\urfave\cli\v2@v2.24.4\sliceflag.go:15:44: undeclared name: any (requires version go1.18 or later)
C:\Users\MyName\go\pkg\mod\github.com\urfave\cli\v2@v2.24.4\sliceflag.go:25:18: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
C:\Users\MyName\go\pkg\mod\github.com\urfave\cli\v2@v2.24.4\sliceflag.go:25:20: undeclared name: any (requires version go1.18 or later)
C:\Users\MyName\go\pkg\mod\github.com\urfave\cli\v2@v2.24.4\sliceflag.go:44:29: type instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
C:\Users\MyName\go\pkg\mod\github.com\urfave\cli\v2@v2.24.4\sliceflag.go:48:30: type instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
C:\Users\MyName\go\pkg\mod\github.com\urfave\cli\v2@v2.24.4\sliceflag.go:52:28: type instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
C:\Users\MyName\go\pkg\mod\github.com\urfave\cli\v2@v2.24.4\sliceflag.go:56:26: type instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
C:\Users\MyName\go\pkg\mod\github.com\urfave\cli\v2@v2.24.4\sliceflag.go:215:24: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
C:\Users\MyName\go\pkg\mod\github.com\urfave\cli\v2@v2.24.4\sliceflag.go:56:26: too many errors

I'm standing in my project root with a go.mod file:

go 1.18

What did you expect?

I expect it to work.

Minimal graphql.schema and models to reproduce

versions

  • go run github.com/99designs/gqlgen version?
    Error when running:

    $ go run github.com/99designs/gqlgen version
    # github.com/urfave/cli/v2
    C:\Users\MyName\go\pkg\mod\github.com\urfave\cli\v2@v2.24.4\sliceflag.go:15:12: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
    C:\Users\MyName\go\pkg\mod\github.com\urfave\cli\v2@v2.24.4\sliceflag.go:15:29: type instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
    C:\Users\MyName\go\pkg\mod\github.com\urfave\cli\v2@v2.24.4\sliceflag.go:15:44: undeclared name: any (requires version go1.18 or later)
    C:\Users\MyName\go\pkg\mod\github.com\urfave\cli\v2@v2.24.4\sliceflag.go:25:18: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
    C:\Users\MyName\go\pkg\mod\github.com\urfave\cli\v2@v2.24.4\sliceflag.go:25:20: undeclared name: any (requires version go1.18 or later)
    C:\Users\MyName\go\pkg\mod\github.com\urfave\cli\v2@v2.24.4\sliceflag.go:44:29: type instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
    C:\Users\MyName\go\pkg\mod\github.com\urfave\cli\v2@v2.24.4\sliceflag.go:48:30: type instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
    C:\Users\MyName\go\pkg\mod\github.com\urfave\cli\v2@v2.24.4\sliceflag.go:52:28: type instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
    C:\Users\MyName\go\pkg\mod\github.com\urfave\cli\v2@v2.24.4\sliceflag.go:56:26: type instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
    C:\Users\MyName\go\pkg\mod\github.com\urfave\cli\v2@v2.24.4\sliceflag.go:215:24: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
    C:\Users\MyName\go\pkg\mod\github.com\urfave\cli\v2@v2.24.4\sliceflag.go:56:26: too many errors
    
  • go version?
    Answer: go version go1.18.3 windows/amd64

@PushpenderSaini0
Copy link

PushpenderSaini0 commented May 24, 2023

I was following the getting started from the docs https://gqlgen.com/getting-started/
I had the same issue, some packages need to be updated.

Running go get -u , will update the packages , this should fix the issue

@hirikarate
Copy link
Author

I was able to run the command by setting specific version go run github.com/99designs/gqlgen@v0.17.31 init.

Using go run is the newer way to replace "tool.go", as said in Go Wiki page how-can-i-track-tool-dependencies-for-a-module

UnAfraid added a commit to UnAfraid/gqlgen that referenced this issue Jul 19, 2023
Added `go mod tidy` in quick start guide to address issues like 99designs#2717, 99designs#2651, 99designs#2641, 99designs#2614 and 99designs#2576
UnAfraid added a commit to UnAfraid/gqlgen that referenced this issue Jul 19, 2023
Added `go mod tidy` in quick start guide to address issues like 99designs#2717, 99designs#2651, 99designs#2641, 99designs#2614 and 99designs#2576
UnAfraid added a commit to UnAfraid/gqlgen that referenced this issue Jul 19, 2023
Added `go mod tidy` in quick start guide to address issues like 99designs#2717, 99designs#2651, 99designs#2641, 99designs#2614 and 99designs#2576
StevenACoffman pushed a commit that referenced this issue Jul 19, 2023
Added `go mod tidy` in quick start guide to address issues like #2717, #2651, #2641, #2614 and #2576
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants