{"action":"created","issue":{"url":"https://api.github.com/repos/almighty/almighty-core/issues/853","repository_url":"https://api.github.com/repos/almighty/almighty-core","labels_url":"https://api.github.com/repos/almighty/almighty-core/issues/853/labels{/name}","comments_url":"https://api.github.com/repos/almighty/almighty-core/issues/853/comments","events_url":"https://api.github.com/repos/almighty/almighty-core/issues/853/events","html_url":"https://github.com/almighty/almighty-core/issues/853","id":209489007,"number":853,"title":"Proposal: have package name constant in doc.go?","user":{"login":"kwk","id":193408,"avatar_url":"https://avatars.githubusercontent.com/u/193408?v=3","gravatar_id":"","url":"https://api.github.com/users/kwk","html_url":"https://github.com/kwk","followers_url":"https://api.github.com/users/kwk/followers","following_url":"https://api.github.com/users/kwk/following{/other_user}","gists_url":"https://api.github.com/users/kwk/gists{/gist_id}","starred_url":"https://api.github.com/users/kwk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwk/subscriptions","organizations_url":"https://api.github.com/users/kwk/orgs","repos_url":"https://api.github.com/users/kwk/repos","events_url":"https://api.github.com/users/kwk/events{/privacy}","received_events_url":"https://api.github.com/users/kwk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"kwk","id":193408,"avatar_url":"https://avatars.githubusercontent.com/u/193408?v=3","gravatar_id":"","url":"https://api.github.com/users/kwk","html_url":"https://github.com/kwk","followers_url":"https://api.github.com/users/kwk/followers","following_url":"https://api.github.com/users/kwk/following{/other_user}","gists_url":"https://api.github.com/users/kwk/gists{/gist_id}","starred_url":"https://api.github.com/users/kwk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwk/subscriptions","organizations_url":"https://api.github.com/users/kwk/orgs","repos_url":"https://api.github.com/users/kwk/repos","events_url":"https://api.github.com/users/kwk/events{/privacy}","received_events_url":"https://api.github.com/users/kwk/received_events","type":"User","site_admin":false},"assignees":[{"login":"kwk","id":193408,"avatar_url":"https://avatars.githubusercontent.com/u/193408?v=3","gravatar_id":"","url":"https://api.github.com/users/kwk","html_url":"https://github.com/kwk","followers_url":"https://api.github.com/users/kwk/followers","following_url":"https://api.github.com/users/kwk/following{/other_user}","gists_url":"https://api.github.com/users/kwk/gists{/gist_id}","starred_url":"https://api.github.com/users/kwk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwk/subscriptions","organizations_url":"https://api.github.com/users/kwk/orgs","repos_url":"https://api.github.com/users/kwk/repos","events_url":"https://api.github.com/users/kwk/events{/privacy}","received_events_url":"https://api.github.com/users/kwk/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2017-02-22T15:33:27Z","updated_at":"2017-02-22T15:55:51Z","closed_at":null,"body":"Can't we establish a habit of some sort that defines a string constant with the package name in the `doc.go` of a package for example? Then we can reuse that everywhere instead of having the package name repeated over and over as a string in the log calls? This actually makes changing the package name much harder than it should be.\r\n\r\nHere's an example of what I consider bad:\r\n\r\n```go\r\nlog.Info(nil, map[string]interface{}{\r\n    \"pkg\": \"remoteworkitem\",\r\n}, \"Workitem does not exist, will be created\")\r\n```\r\n\r\nThis would be better IMHO\r\n\r\n```go\r\nlog.Info(nil, map[string]interface{}{\r\n    \"pkg\": pkgRemoteworkitem,\r\n}, \"Workitem does not exist, will be created\")\r\n```\r\n\r\nAnd in `remoteworkitem/doc.go` (for example) we could define:\r\n\r\n```go\r\n// The package remoteworkitem bla bla bla\r\npackage remoteworkitem\r\n\r\nconst pkgRemoteworkitem = \"remoteworkitem\"\r\n```\r\n\r\nPlease comment, what you think."},"comment":{"url":"https://api.github.com/repos/almighty/almighty-core/issues/comments/281710881","html_url":"https://github.com/almighty/almighty-core/issues/853#issuecomment-281710881","issue_url":"https://api.github.com/repos/almighty/almighty-core/issues/853","id":281710881,"user":{"login":"hectorj2f","id":3602792,"avatar_url":"https://avatars.githubusercontent.com/u/3602792?v=3","gravatar_id":"","url":"https://api.github.com/users/hectorj2f","html_url":"https://github.com/hectorj2f","followers_url":"https://api.github.com/users/hectorj2f/followers","following_url":"https://api.github.com/users/hectorj2f/following{/other_user}","gists_url":"https://api.github.com/users/hectorj2f/gists{/gist_id}","starred_url":"https://api.github.com/users/hectorj2f/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hectorj2f/subscriptions","organizations_url":"https://api.github.com/users/hectorj2f/orgs","repos_url":"https://api.github.com/users/hectorj2f/repos","events_url":"https://api.github.com/users/hectorj2f/events{/privacy}","received_events_url":"https://api.github.com/users/hectorj2f/received_events","type":"User","site_admin":false},"created_at":"2017-02-22T15:55:51Z","updated_at":"2017-02-22T15:55:51Z","body":"@kwk I propose to have a constant whose value is created using the `reflect.TypeOf(Empty{}).PkgPath()`. Or even get the package from the caller.."}}
{"actor":{"display_login":"hectorj2f"}}