valyala/fasthttp

go get github.com/valyala/fasthttp compile errors

kngu9 opened this issue · 5 comments

kngu9 commented

I seem to be having problems when I am trying to fetch the package. This is the error I am getting:

github.com/valyala/fasthttp

src/github.com/valyala/fasthttp/bytesconv.go:53: date.In(gmtLocation).AppendFormat undefined (type time.Time has no field or method AppendFormat)
src/github.com/valyala/fasthttp/header.go:1125: undefined: bytes.LastIndexByte
src/github.com/valyala/fasthttp/header.go:1450: r.Discard undefined (type *bufio.Reader has no field or method Discard)
src/github.com/valyala/fasthttp/http.go:430: undefined: io.CopyBuffer
src/github.com/valyala/fasthttp/uri.go:221: undefined: bytes.LastIndexByte
src/github.com/valyala/fasthttp/uri.go:233: undefined: bytes.LastIndexByte

what go version do you have - type go version in your command line.

kngu9 commented

go version go1.4.2 darwin/amd64

Your issue is your go version, the error is Time.AppendFormat which was added to the language in 2015/04/10 - April, and your go version was released on 2015/02/17 - February.

Download the latest go 1.5.1 https://golang.org/dl/

Actually that brings up the point that this library should explicitly state what go version it was built on / required to run on.

Explicitly stated in readme that fasthttp supports only go1.5+.

Older versions won't be supported, since their standard library miss useful functions and I have no desire writing workarounds for them :) See the initial bug report from @kngu9 for the list of missing functions.