{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/12392","labels_url":"https://api.github.com/repos/golang/go/issues/12392/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/12392/comments","events_url":"https://api.github.com/repos/golang/go/issues/12392/events","html_url":"https://github.com/golang/go/issues/12392","id":103798578,"number":12392,"title":"go/types: cannot import package with source code but no installed archive","user":{"login":"kr","id":4178,"avatar_url":"https://avatars.githubusercontent.com/u/4178?v=3","gravatar_id":"","url":"https://api.github.com/users/kr","html_url":"https://github.com/kr","followers_url":"https://api.github.com/users/kr/followers","following_url":"https://api.github.com/users/kr/following{/other_user}","gists_url":"https://api.github.com/users/kr/gists{/gist_id}","starred_url":"https://api.github.com/users/kr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kr/subscriptions","organizations_url":"https://api.github.com/users/kr/orgs","repos_url":"https://api.github.com/users/kr/repos","events_url":"https://api.github.com/users/kr/events{/privacy}","received_events_url":"https://api.github.com/users/kr/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"griesemer","id":8528975,"avatar_url":"https://avatars.githubusercontent.com/u/8528975?v=3","gravatar_id":"","url":"https://api.github.com/users/griesemer","html_url":"https://github.com/griesemer","followers_url":"https://api.github.com/users/griesemer/followers","following_url":"https://api.github.com/users/griesemer/following{/other_user}","gists_url":"https://api.github.com/users/griesemer/gists{/gist_id}","starred_url":"https://api.github.com/users/griesemer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/griesemer/subscriptions","organizations_url":"https://api.github.com/users/griesemer/orgs","repos_url":"https://api.github.com/users/griesemer/repos","events_url":"https://api.github.com/users/griesemer/events{/privacy}","received_events_url":"https://api.github.com/users/griesemer/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-08-28T21:27:38Z","updated_at":"2015-08-28T22:43:59Z","closed_at":"2015-08-28T22:43:59Z","body":"Go version 1.5\r\n\r\n### Summary\r\n\r\nWe've run into some behavior we didn't expect from go/types importing packages. If a package `p` has been imported (by some other package) and its source code is present but not installed (that is, there is no package archive such as `$GOROOT/pkg/darwin_amd64/p.a`) then Check returns an error saying it can't find the package.\r\n\r\nWe're not sure if this is intended behavior, but we found it surprising.\r\n\r\ncc @tessr \r\n\r\nWe've tried to produce a minimal test case:\r\nhttps://github.com/kr/gotypesrepro\r\n\r\n### Steps to reproduce\r\n\r\n\t1. git clone https://github.com/kr/gotypesrepro $GOPATH/src/p\r\n\t2. cd $GOPATH/src/p\r\n\t3. go run try.go # fails\r\n\t4. go install p\r\n\t5. go run try.go # now it works\r\n\r\n### Expected output\r\n\r\n\tpackage testdata (\"testdata\")\r\n\tpackage testdata (\"testdata\")\r\n\r\n### Actual output\r\n\r\n\ttestdata/import.go:3:8: could not import p (can't find import: p)\r\n\tpackage testdata (\"testdata\")"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/135904859","html_url":"https://github.com/golang/go/issues/12392#issuecomment-135904859","issue_url":"https://api.github.com/repos/golang/go/issues/12392","id":135904859,"user":{"login":"griesemer","id":8528975,"avatar_url":"https://avatars.githubusercontent.com/u/8528975?v=3","gravatar_id":"","url":"https://api.github.com/users/griesemer","html_url":"https://github.com/griesemer","followers_url":"https://api.github.com/users/griesemer/followers","following_url":"https://api.github.com/users/griesemer/following{/other_user}","gists_url":"https://api.github.com/users/griesemer/gists{/gist_id}","starred_url":"https://api.github.com/users/griesemer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/griesemer/subscriptions","organizations_url":"https://api.github.com/users/griesemer/orgs","repos_url":"https://api.github.com/users/griesemer/repos","events_url":"https://api.github.com/users/griesemer/events{/privacy}","received_events_url":"https://api.github.com/users/griesemer/received_events","type":"User","site_admin":false},"created_at":"2015-08-28T22:43:59Z","updated_at":"2015-08-28T22:43:59Z","body":"This is intended behavior and has been much discussed (<proper link here>). The type checker purely type-checks a package for which the corresponding package file ASTs are provided. It doesn't know about the build environment, source code, etc. It relies on importers (go/importer) for imported packages. The currently installed importers only support gc or gccgo compiled packages. There is no \"source importer\" yet."}}