{"action":"opened","issue":{"url":"https://api.github.com/repos/nsf/gocode/issues/352","repository_url":"https://api.github.com/repos/nsf/gocode","labels_url":"https://api.github.com/repos/nsf/gocode/issues/352/labels{/name}","comments_url":"https://api.github.com/repos/nsf/gocode/issues/352/comments","events_url":"https://api.github.com/repos/nsf/gocode/issues/352/events","html_url":"https://github.com/nsf/gocode/issues/352","id":155035265,"number":352,"title":"struct problems by new binary format","user":{"login":"zchee","id":6366270,"avatar_url":"https://avatars.githubusercontent.com/u/6366270?v=3","gravatar_id":"","url":"https://api.github.com/users/zchee","html_url":"https://github.com/zchee","followers_url":"https://api.github.com/users/zchee/followers","following_url":"https://api.github.com/users/zchee/following{/other_user}","gists_url":"https://api.github.com/users/zchee/gists{/gist_id}","starred_url":"https://api.github.com/users/zchee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zchee/subscriptions","organizations_url":"https://api.github.com/users/zchee/orgs","repos_url":"https://api.github.com/users/zchee/repos","events_url":"https://api.github.com/users/zchee/events{/privacy}","received_events_url":"https://api.github.com/users/zchee/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-16T14:00:02Z","updated_at":"2016-05-16T14:00:02Z","closed_at":null,"body":"I found two bugs by new binary format (Go devel).\r\n\r\nFirst, It's simple.\r\n\r\n```go\r\npackage main\r\n\r\ntype TestStruct struct {\r\n\tName string\r\n}\r\n\r\nfunc NewTestStruct(name string) *TestStruct {\r\n\treturn &TestStruct{\r\n\t\tName: name,\r\n\t}\r\n}\r\n\r\n// This line\r\nfunc (t *\r\n\r\nfunc (t *TestStruct) Test(name string) error {\r\n\tt.Name = name\r\n\r\n\treturn nil\r\n}\r\n```\r\nIf type any character after pointer (e.g. `func (t *T`), gocode occur `PANIC`.\r\nBut if that situation, works fine.\r\n\r\n1. `func (t T`\r\n - no poitner\r\n2. Remove `func (t *TestStruct) Test(name string) error` function block\r\n - e.g. comment out\r\n3. Move `func (t *` to end of file\r\n4. `152` byte offset\r\n\r\n3 is this situation.\r\n```go\r\n.\r\n.\r\nfunc (t *TestStruct) Test(name string) error {\r\n\tt.Name = name\r\n\r\n\treturn nil\r\n}\r\n\r\nfunc (t *T\r\n\r\n```\r\n\r\ngist: https://gist.github.com/zchee/0789790800f77ad9fa2d06783bc31de2#file-struct-go\r\nbyte offset: `151` (include any charactor e.g. `T`)\r\ncmd: `gocode --in ./struct.go autocomplete 151`\r\n\r\n===\r\n\r\nNext is edge case(?).\r\nSorry, I tried several code, but I could not find other case.\r\nIf I found other case, will comment.\r\n\r\nThis sample is simple code for remote connection to `delve` headless server.\r\n\r\n```go\r\npackage main\r\n\r\nimport \"github.com/derekparker/delve/service/rpc2\"\r\n\r\nconst addr = \"localhost:41222\" // d:4 l:12 v:22\r\n\r\ntype Delve struct {\r\n\tclient *rpc2.RPCClient\r\n}\r\n\r\nfunc newDelve(addr string) *Delve {\r\n\tclient := rpc2.NewClient(addr)\r\n\treturn &Delve{\r\n\t\tclient: client,\r\n\t}\r\n}\r\n\r\nfunc pointerStruct() {\r\n\tclient := rpc2.NewClient(addr)\r\n\tbp, _ := client.GetBreakpoint(-1) // *api.Breakpoint\r\n\r\n\tbp.\r\n}\r\n```\r\ngist: https://gist.github.com/zchee/0789790800f77ad9fa2d06783bc31de2#file-delve-go\r\nbyte offset: `365`\r\ncmd: `gocode --in ./delve.go autocomplete 365`\r\n\r\nDoes not return any complete word after `bp.`.\r\nExpected behavior is return that struct values.\r\nhttps://github.com/derekparker/delve/blob/master/service/api/types.go#L35-L69 \r\nbut actual behavior is nothing.\r\n\r\nPlease comment if you need other information.\r\nThanks."}}