Error : github.com\gin-gonic\gin\logger.go:61: undefined: isatty.IsCygwinTerminal
System:windows amd64
run code:
package main
import "github.com/gin-gonic/gin"
func main() {
r := gin.Default()
r.GET("/ping", func(c *gin.Context) {
c.JSON(200, gin.H{
"message": "pong",
})
})
r.Run() // listen and serve on 0.0.0.0:8080
}
update package github.com/mattn/go-isatty
go get -u github.com/mattn/go-isatty
Try the @mkdym solution. Please feel free to reopen this issue if you face the same problem again.
I ran into this when I was using [Glide]. When examining my Glide.lock file it is pulling in an older version where this error occurs. What can we do to prevent Glide from pulling in this old version of go-isatty ?
- name: github.com/gin-gonic/gin
version: d459835d2b077e44f7c9b453505ee29881d5d12d
subpackages:
- binding
- render
<SNIP>
- name: github.com/mattn/go-isatty
version: 30a891c33c7cde7b02a981314b4228ec99380cca
@sc68cal Please update the go-isatty using Glide or remove go-isatty folder from the vendor folder and fetch again.
I have this same issue right now and nothing above helped. I tried removing entire vendor folder and installing glide again. Then I tried removing only go-isatty folder. Again the same error. I tried updating it. Same error. Any other ideas?
In your glide.lock change the reference
Then run
glide install
Most helpful comment
update package
github.com/mattn/go-isatty