gin-gonic/contrib

gzip: c.Header is not exposed

gustavopaes opened this issue · 4 comments

I am getting this message error when I follow the example:

gpaes@cebola:~/gocode/src/heramodas.com.br/butik$ go run app.go 
# github.com/gin-gonic/contrib/gzip
../../github.com/gin-gonic/contrib/gzip/gzip.go:29: c.Header undefined (type *gin.Context has no field or method Header)
../../github.com/gin-gonic/contrib/gzip/gzip.go:30: c.Header undefined (type *gin.Context has no field or method Header)
../../github.com/gin-gonic/contrib/gzip/gzip.go:33: c.Header undefined (type *gin.Context has no field or method Header)
gpaes@cebola:~/gocode/src/heramodas.com.br/butik$ 

I used reflect to see what is exposed in c *gin.Context and I did not find c.Header. May be some gin update removed this function?

@gustavopaes Please, can you update to the last Gin version? I am sorry.
The good news: this is never going to happen again. Since Gin 1.0 the API is frozen.

Great! I did that and worked.

I just removed the folder gin-gonic and ran go get again. Do you know if exist some go update?

@gustavopaes Yes there is!

go get -u github.com/gin-gonic/gin

it also updates recursively all the dependencies.

Thank you!