Gin: Error : github.com\gin-gonic\gin\logger.go:61: undefined: isatty.IsCygwinTerminal

Created on 3 Jul 2017  路  6Comments  路  Source: gin-gonic/gin

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
}

Most helpful comment

update package github.com/mattn/go-isatty

go get -u github.com/mattn/go-isatty

All 6 comments

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

  • name: github.com/mattn/go-isatty
    version: a5cdd64afdee435007ee3e9f6ed4684af949d568

Then run
glide install

Was this page helpful?
0 / 5 - 0 ratings

Related issues

boneq picture boneq  路  3Comments

CodingPapi picture CodingPapi  路  3Comments

mastrolinux picture mastrolinux  路  3Comments

nxvl picture nxvl  路  3Comments

gplume picture gplume  路  3Comments