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/sys@v0.0.0-20200116001909-b77594299b42/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/sys@v0.0.0-20200116001909-b77594299b42/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/sys@v0.0.0-20200116001909-b77594299b42/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/sys@v0.0.0-20200116001909-b77594299b42/unix/zsyscall_darwin_amd64.go:28:3: //go:linkname must refer to declared function or variable /Users/vothanhtung/go/pkg/mod/golang.org/x/sys@v0.0.0-20200116001909-b77594299b42/unix/zsyscall_darwin_amd64.go:43:3: //go:linkname must refer to declared function or variable /Users/vothanhtung/go/pkg/mod/golang.org/x/sys@v0.0.0-20200116001909-b77594299b42/unix/zsyscall_darwin_amd64.go:59:3: //go:linkname must refer to declared function or variable /Users/vothanhtung/go/pkg/mod/golang.org/x/sys@v0.0.0-20200116001909-b77594299b42/unix/zsyscall_darwin_amd64.go:75:3: //go:linkname must refer to declared function or variable /Users/vothanhtung/go/pkg/mod/golang.org/x/sys@v0.0.0-20200116001909-b77594299b42/unix/zsyscall_darwin_amd64.go:90:3: //go:linkname must refer to declared function or variable /Users/vothanhtung/go/pkg/mod/golang.org/x/sys@v0.0.0-20200116001909-b77594299b42/unix/zsyscall_darwin_amd64.go:105:3: //go:linkname must refer to declared function or variable /Users/vothanhtung/go/pkg/mod/golang.org/x/sys@v0.0.0-20200116001909-b77594299b42/unix/zsyscall_darwin_amd64.go:121:3: //go:linkname must refer to declared function or variable /Users/vothanhtung/go/pkg/mod/golang.org/x/sys@v0.0.0-20200116001909-b77594299b42/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

Comment From: SeKaBo

same :<

Comment From: jbzion

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

Comment From: appleboy

@jbzion Thanks for your testing.

Comment From: Rampl1ng

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

Comment From: pscheid92

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

Comment From: ccaspanello

StackOverflow topic: https://stackoverflow.com/questions/71507321/go-1-18-build-error-on-mac-unix-syscall-darwin-1-13-go253-golinkname-mus