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

go 1.18 failed to start server #3082

Closed
thanhtungka91 opened this issue Mar 16, 2022 · 6 comments
Closed

go 1.18 failed to start server #3082

thanhtungka91 opened this issue Mar 16, 2022 · 6 comments
Labels

Comments

@thanhtungka91
Copy link

Description

How to reproduce

just start gin server

package main

import (
	"github.com/gin-gonic/gin"
)

func main() {
	g := gin.Default()
	g.GET("/hello/:name", func(c *gin.Context) {
		c.String(200, "Hello %s", c.Param("name"))
	})
	g.Run(":9000")
}

Expectations

It should working fine like other previous version

$ curl http://localhost:8201/hello/world
Hello world

Actual result

golang.org/x/sys/unix

/Users/vothanhtung/go/pkg/mod/golang.org/x/[email protected]/unix/syscall_darwin.1_13.go:25:3: //go:linkname must refer to declared function or variable
/Users/vothanhtung/go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.1_13.go:27:3: //go:linkname must refer to declared function or variable
/Users/vothanhtung/go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.1_13.go:40:3: //go:linkname must refer to declared function or variable
/Users/vothanhtung/go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.go:28:3: //go:linkname must refer to declared function or variable
/Users/vothanhtung/go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.go:43:3: //go:linkname must refer to declared function or variable
/Users/vothanhtung/go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.go:59:3: //go:linkname must refer to declared function or variable
/Users/vothanhtung/go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.go:75:3: //go:linkname must refer to declared function or variable
/Users/vothanhtung/go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.go:90:3: //go:linkname must refer to declared function or variable
/Users/vothanhtung/go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.go:105:3: //go:linkname must refer to declared function or variable
/Users/vothanhtung/go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.go:121:3: //go:linkname must refer to declared function or variable
/Users/vothanhtung/go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.go:121:3: too many errors

$ curl -i http://localhost:8201/hello/world
<YOUR RESULT>

Environment

  • go version: go version go1.18 darwin/amd64
  • gin version (or commit ref): github.com/gin-gonic/gin v1.7.7
  • operating system: Mac OS m1
@SeKaBo
Copy link

SeKaBo commented Mar 16, 2022

same :<

@jbzion
Copy link

jbzion commented Mar 17, 2022

The following method worked for me
in go.mod
golang.org/x/sys v0.0.0-20200116001909-b77594299b42
use
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069
replace
then it's solved

@appleboy
Copy link
Member

@jbzion Thanks for your testing.

@Rampl1ng
Copy link

Rampl1ng commented Apr 1, 2022

I tried to input go get -u . in terminal.
It worked for me.

@pscheid92
Copy link

FYI: The underlying issue is an outdated version of golang.org/x/sys/unix in one of our dependencies (mattn/go-isatty#72).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants