{"action":"created","issue":{"url":"https://api.github.com/repos/prometheus/prometheus/issues/1720","repository_url":"https://api.github.com/repos/prometheus/prometheus","labels_url":"https://api.github.com/repos/prometheus/prometheus/issues/1720/labels{/name}","comments_url":"https://api.github.com/repos/prometheus/prometheus/issues/1720/comments","events_url":"https://api.github.com/repos/prometheus/prometheus/issues/1720/events","html_url":"https://github.com/prometheus/prometheus/issues/1720","id":159395217,"number":1720,"title":"promql Go import problem: use of vendored package not allowed","user":{"login":"fatih","id":438920,"avatar_url":"https://avatars.githubusercontent.com/u/438920?v=3","gravatar_id":"","url":"https://api.github.com/users/fatih","html_url":"https://github.com/fatih","followers_url":"https://api.github.com/users/fatih/followers","following_url":"https://api.github.com/users/fatih/following{/other_user}","gists_url":"https://api.github.com/users/fatih/gists{/gist_id}","starred_url":"https://api.github.com/users/fatih/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fatih/subscriptions","organizations_url":"https://api.github.com/users/fatih/orgs","repos_url":"https://api.github.com/users/fatih/repos","events_url":"https://api.github.com/users/fatih/events{/privacy}","received_events_url":"https://api.github.com/users/fatih/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-06-09T12:26:24Z","updated_at":"2016-06-09T13:13:14Z","closed_at":null,"body":"**What did you do?**\r\n\r\nI've tried to import the `github.com/prometheus/common/model` package so I can construct a `promql.AlertStmt` from scratch. Here is the demo code that I'm using:\r\n\r\n```\r\npackage main\r\n\r\nimport (\r\n\t\"github.com/prometheus/common/model\"\r\n\t\"github.com/prometheus/prometheus/promql\"\r\n)\r\n\r\nfunc main() {\r\n\t_ = &promql.AlertStmt{\r\n\t\tAnnotations: model.LabelSet{},\r\n\t}\r\n}\r\n```\r\n\r\nBuilding this package is not possible because `promql` uses a vendored package and thus I've got this error:\r\n\r\n```\r\n./demo.go:10: cannot use \"github.com/prometheus/common/model\".LabelSet literal (type \"github.com/prometheus/common/model\".LabelSet) as type \"github.com/prometheus/prometheus/vendor/github.com/prometheus/common/model\".LabelSet in field value\r\n```\r\n\r\nThis is ok, because they really are two different packages (one is vendored, and the other one is pulled by me and put into GOPATH), but if you go and use the vendored import path:\r\n\r\n```go\r\npackage main\r\n\r\nimport (\r\n\t\"github.com/prometheus/prometheus/promql\"\r\n\t\"github.com/prometheus/prometheus/vendor/github.com/prometheus/common/model\"\r\n)\r\n\r\nfunc main() {\r\n\t_ = &promql.AlertStmt{\r\n\t\tAnnotations: model.LabelSet{},\r\n\t}\r\n}\r\n```\r\n\r\nNow you get the error: \r\n\r\n```\r\npackage demo\r\n\timports github.com/prometheus/prometheus/vendor/github.com/prometheus/common/model: use of vendored package not allowed\r\n```\r\n\r\n**What did you expect to see?**\r\n\r\nI want to be able to create a custom `promql.AlertStmt` with the `Annotations` field\r\n\r\n**What did you see instead? Under which circumstances?**\r\n\r\nAs described above, it's not possible to create such a value\r\n\r\n**Environment**\r\n\r\n```\r\ngo version go1.6 darwin/amd64\r\n```\r\n\r\n* System information:\r\n\r\n```\r\nDarwin Fatihs-MacBook-Pro.local 15.5.0 x86_64\r\n```\r\n\r\n* Prometheus version: \r\n\r\nI'm using latest master with Git SHA `a08943e6d347119bfb1b50e738fca577e5733290`\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/prometheus/prometheus/issues/comments/224890140","html_url":"https://github.com/prometheus/prometheus/issues/1720#issuecomment-224890140","issue_url":"https://api.github.com/repos/prometheus/prometheus/issues/1720","id":224890140,"user":{"login":"fatih","id":438920,"avatar_url":"https://avatars.githubusercontent.com/u/438920?v=3","gravatar_id":"","url":"https://api.github.com/users/fatih","html_url":"https://github.com/fatih","followers_url":"https://api.github.com/users/fatih/followers","following_url":"https://api.github.com/users/fatih/following{/other_user}","gists_url":"https://api.github.com/users/fatih/gists{/gist_id}","starred_url":"https://api.github.com/users/fatih/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fatih/subscriptions","organizations_url":"https://api.github.com/users/fatih/orgs","repos_url":"https://api.github.com/users/fatih/repos","events_url":"https://api.github.com/users/fatih/events{/privacy}","received_events_url":"https://api.github.com/users/fatih/received_events","type":"User","site_admin":false},"created_at":"2016-06-09T13:13:13Z","updated_at":"2016-06-09T13:13:13Z","body":"@brian-brazil well you said it's not guaranteed and I said it should. Not sure why you wrote this comment. Happy to discuss it in another issue. "}}
{"actor":{"display_login":"fatih"}}