{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/14547","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/14547/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/14547/comments","events_url":"https://api.github.com/repos/golang/go/issues/14547/events","html_url":"https://github.com/golang/go/issues/14547","id":137012023,"number":14547,"title":"go fmt template's context initialized incompletely (GOPATH not assigned)","user":{"login":"gima","id":1252061,"avatar_url":"https://avatars.githubusercontent.com/u/1252061?v=3","gravatar_id":"","url":"https://api.github.com/users/gima","html_url":"https://github.com/gima","followers_url":"https://api.github.com/users/gima/followers","following_url":"https://api.github.com/users/gima/following{/other_user}","gists_url":"https://api.github.com/users/gima/gists{/gist_id}","starred_url":"https://api.github.com/users/gima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gima/subscriptions","organizations_url":"https://api.github.com/users/gima/orgs","repos_url":"https://api.github.com/users/gima/repos","events_url":"https://api.github.com/users/gima/events{/privacy}","received_events_url":"https://api.github.com/users/gima/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-02-28T06:10:15Z","updated_at":"2016-02-28T07:57:44Z","closed_at":null,"body":"Please answer these questions before submitting your issue. Thanks!\r\n\r\n1. What version of Go are you using (`go version`)?\r\n> ~~~\r\n> go version go1.6 linux/amd64\r\n> ~~~\r\n\r\n2. What operating system and processor architecture are you using (`go env`)?\r\n> ~~~\r\n> GOARCH=\"amd64\"\r\n> GOHOSTARCH=\"amd64\"\r\n> GOHOSTOS=\"linux\"\r\n> GOOS=\"linux\"\r\n> ~~~\r\n\r\n3. What did you do?\r\n> **`go list -f '{{ context.GOPATH }}'`**\r\n\r\n\r\n4. What did you expect to see?\r\n> Something along the lines of `go env | grep GOPATH`\r\n\r\n\r\n5. What did you see instead?\r\n> Nothing was returned.\r\n\r\n### Investigation\r\n\r\nI believe this to be the problem:\r\n\r\nThe `Context` struct for the template is constructed in [context.go#L24](https://github.com/golang/go/blob/3cb870d47b5611465c46c6a6512b7f059584c66f/src/cmd/go/context.go#L24) and assigned in [list.go#L160](https://github.com/golang/go/blob/3cb870d47b5611465c46c6a6512b7f059584c66f/src/cmd/go/list.go#L160), but the field GOPATH doesn't seem to be assigned.\r\n\r\nI'm not knownledgeable enough to know if this has some meaning, but it seems like a bug."},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/189817206","html_url":"https://github.com/golang/go/issues/14547#issuecomment-189817206","issue_url":"https://api.github.com/repos/golang/go/issues/14547","id":189817206,"user":{"login":"gima","id":1252061,"avatar_url":"https://avatars.githubusercontent.com/u/1252061?v=3","gravatar_id":"","url":"https://api.github.com/users/gima","html_url":"https://github.com/gima","followers_url":"https://api.github.com/users/gima/followers","following_url":"https://api.github.com/users/gima/following{/other_user}","gists_url":"https://api.github.com/users/gima/gists{/gist_id}","starred_url":"https://api.github.com/users/gima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gima/subscriptions","organizations_url":"https://api.github.com/users/gima/orgs","repos_url":"https://api.github.com/users/gima/repos","events_url":"https://api.github.com/users/gima/events{/privacy}","received_events_url":"https://api.github.com/users/gima/received_events","type":"User","site_admin":false},"created_at":"2016-02-28T07:57:44Z","updated_at":"2016-02-28T07:57:44Z","body":"Yes, the first element of GOPATH."}}