Skip to content

map[int]int failed to parse #305

@fananchong

Description

@fananchong

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions