Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

map[int]int failed to parse #305

Open
fananchong opened this issue Dec 17, 2021 · 0 comments
Open

map[int]int failed to parse #305

fananchong opened this issue Dec 17, 2021 · 0 comments

Comments

@fananchong
Copy link

My code is :

package main

const Eight = 8

type MyInt int
type Data []byte
type Test1 map[string]int
type Test2 map[int]int

type Struct struct {
	Which  map[int]*MyInt
	Which1 Test1
	Which2 Test2
	Other  Data
	Nums   [Eight]float64
}

func main() {

}

and, shell cmd like this:

fananchong@ubuntu-vm:~/msgp_test$ msgp -file=main.go -o=main_msgp.go -v
Input: "main.go"
warn: main.go: Struct: Which: ignored
warn: main.go: Test2: failed to parse
info: main.go: Struct: inlining Test1
warn: main.go: Struct: unresolved identifier: Test2
info: main.go: Struct: inlining Data
Wrote and formatted "main_msgp.go"
Wrote and formatted "main_msgp_test.go"
fananchong@ubuntu-vm:~/msgp_test$ go build
# msgp_test
./main_msgp.go:162:18: z.Which2.DecodeMsg undefined (type Test2 has no field or method DecodeMsg)
./main_msgp.go:236:16: z.Which2.EncodeMsg undefined (type Test2 has no field or method EncodeMsg)
./main_msgp.go:284:19: z.Which2.MarshalMsg undefined (type Test2 has no field or method MarshalMsg)
./main_msgp.go:350:23: z.Which2.UnmarshalMsg undefined (type Test2 has no field or method UnmarshalMsg)
./main_msgp.go:404:19: z.Which2.Msgsize undefined (type Test2 has no field or method Msgsize)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant