ugorji / go

idiomatic codec and rpc lib for msgpack, cbor, json, etc. msgpack.org[Go]
MIT License
1.87k stars 295 forks source link

unable to generate code for http.Header after ugorji/go@f081086 #111

Closed rjeczalik closed 9 years ago

rjeczalik commented 9 years ago

Regression after https://github.com/ugorji/go/commit/f08108649873ee0b9c29cf1d6191a51e2b8ca3be.

// bug.go
package bug

import "net/http"

type RawResponse struct {
        Header http.Header
}

Generated code fails to build with:

$ codecgen -o bug.generated.go bug.go
$ go build .
# github.com/rjeczalik/mis
./bug.generated.go:259: h.encSlicestring undefined (type codecSelfer6853 has no field or method encSlicestring)
./bug.generated.go:308: h.decSlicestring undefined (type codecSelfer6853 has no field or method decSlicestring)
./bug.generated.go:339: h.decSlicestring undefined (type codecSelfer6853 has no field or method decSlicestring)
ugorji commented 9 years ago

Please re-generate codecgen and re-try. ie. run

go get -u github.com/ugorji/go/codecgen github.com/ugorji/go

Then re-run codecgen.

ugorji commented 9 years ago

disregard comment. I think the change I made to pass notfastpath tag in codecgen may be an issue here.

Let me look into this.

ugorji commented 9 years ago

Fixed now. Shortsightedness on my part. Go 1.5 build is slower now, and fast-path file is large, so was trying to reduce codecgen run time by skipping the large fast-path. But that file is needed, as the code for all the typical slice types is already there.

Anyway, fixed now.

Please re-generate codecgen and re-try. ie. run

go get -u github.com/ugorji/go/codecgen github.com/ugorji/go

Then re-run codecgen.

rjeczalik commented 9 years ago

@ugorji Thanks! :)