{"action":"created","comment":{"url":"https://api.github.com/repos/openconfig/goyang/pulls/comments/44615515","id":44615515,"diff_hunk":"@@ -179,17 +179,26 @@ func (s *Module) FullName() string {\n // GetPrefix returns the proper prefix of m.  Useful when looking up types\n // in modules found by FindModuleByPrefix.\n func (m *Module) GetPrefix() string {\n-\tif m == nil {\n+\tpfx := m.getPrefix()\n+\tif pfx == nil {\n \t\t// This case can be true during testing.\n \t\treturn \"\"\n \t}\n-\tif m.Prefix != nil {\n-\t\treturn m.Prefix.Name\n+\treturn pfx.Name\n+}\n+\n+func (m *Module) getPrefix() *Value {\n+\tif m == nil {\n+\t\treturn nil\n+\t} else if m.Prefix != nil {\n+\t\treturn m.Prefix\n+\t} else if m.BelongsTo != nil {\n+\t\treturn m.BelongsTo.Prefix\n \t}","path":"pkg/yang/yang.go","position":null,"original_position":22,"commit_id":"7ca4dbbc6724c7c1d3e2552dc9b667d5f02f933d","original_commit_id":"89b2509cda4254981b06f93336da0ce31585656f","user":{"login":"andaru","id":685639,"avatar_url":"https://avatars.githubusercontent.com/u/685639?v=3","gravatar_id":"","url":"https://api.github.com/users/andaru","html_url":"https://github.com/andaru","followers_url":"https://api.github.com/users/andaru/followers","following_url":"https://api.github.com/users/andaru/following{/other_user}","gists_url":"https://api.github.com/users/andaru/gists{/gist_id}","starred_url":"https://api.github.com/users/andaru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andaru/subscriptions","organizations_url":"https://api.github.com/users/andaru/orgs","repos_url":"https://api.github.com/users/andaru/repos","events_url":"https://api.github.com/users/andaru/events{/privacy}","received_events_url":"https://api.github.com/users/andaru/received_events","type":"User","site_admin":false},"body":"Done in the following commit","created_at":"2015-11-12T02:28:48Z","updated_at":"2015-11-12T02:28:48Z","html_url":"https://github.com/openconfig/goyang/pull/11#discussion_r44615515","pull_request_url":"https://api.github.com/repos/openconfig/goyang/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/openconfig/goyang/pulls/comments/44615515"},"html":{"href":"https://github.com/openconfig/goyang/pull/11#discussion_r44615515"},"pull_request":{"href":"https://api.github.com/repos/openconfig/goyang/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/openconfig/goyang/pulls/11","id":50447977,"html_url":"https://github.com/openconfig/goyang/pull/11","diff_url":"https://github.com/openconfig/goyang/pull/11.diff","patch_url":"https://github.com/openconfig/goyang/pull/11.patch","issue_url":"https://api.github.com/repos/openconfig/goyang/issues/11","number":11,"state":"open","locked":false,"title":"Set every Entry's Prefix ","user":{"login":"andaru","id":685639,"avatar_url":"https://avatars.githubusercontent.com/u/685639?v=3","gravatar_id":"","url":"https://api.github.com/users/andaru","html_url":"https://github.com/andaru","followers_url":"https://api.github.com/users/andaru/followers","following_url":"https://api.github.com/users/andaru/following{/other_user}","gists_url":"https://api.github.com/users/andaru/gists{/gist_id}","starred_url":"https://api.github.com/users/andaru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andaru/subscriptions","organizations_url":"https://api.github.com/users/andaru/orgs","repos_url":"https://api.github.com/users/andaru/repos","events_url":"https://api.github.com/users/andaru/events{/privacy}","received_events_url":"https://api.github.com/users/andaru/received_events","type":"User","site_admin":false},"body":"Change `Entry.Prefix` from a string to a `*Value`, set it based on the current `Module`s `Prefix` if it is not explicitly set.\r\n\r\nAdd a test to confirm we get the correct prefix for a `uses` case across YANG modules.\r\n\r\nThis is designed to address issue #7, the first issue related to a parent issue (#5)","created_at":"2015-11-11T22:49:32Z","updated_at":"2015-11-12T02:28:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5a20f722b169f62e64383d5472d8e5666e6ee7f9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openconfig/goyang/pulls/11/commits","review_comments_url":"https://api.github.com/repos/openconfig/goyang/pulls/11/comments","review_comment_url":"https://api.github.com/repos/openconfig/goyang/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openconfig/goyang/issues/11/comments","statuses_url":"https://api.github.com/repos/openconfig/goyang/statuses/7ca4dbbc6724c7c1d3e2552dc9b667d5f02f933d","head":{"label":"andaru:andaru/entry-prefix","ref":"andaru/entry-prefix","sha":"7ca4dbbc6724c7c1d3e2552dc9b667d5f02f933d","user":{"login":"andaru","id":685639,"avatar_url":"https://avatars.githubusercontent.com/u/685639?v=3","gravatar_id":"","url":"https://api.github.com/users/andaru","html_url":"https://github.com/andaru","followers_url":"https://api.github.com/users/andaru/followers","following_url":"https://api.github.com/users/andaru/following{/other_user}","gists_url":"https://api.github.com/users/andaru/gists{/gist_id}","starred_url":"https://api.github.com/users/andaru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andaru/subscriptions","organizations_url":"https://api.github.com/users/andaru/orgs","repos_url":"https://api.github.com/users/andaru/repos","events_url":"https://api.github.com/users/andaru/events{/privacy}","received_events_url":"https://api.github.com/users/andaru/received_events","type":"User","site_admin":false},"repo":{"id":46012811,"name":"goyang","full_name":"andaru/goyang","owner":{"login":"andaru","id":685639,"avatar_url":"https://avatars.githubusercontent.com/u/685639?v=3","gravatar_id":"","url":"https://api.github.com/users/andaru","html_url":"https://github.com/andaru","followers_url":"https://api.github.com/users/andaru/followers","following_url":"https://api.github.com/users/andaru/following{/other_user}","gists_url":"https://api.github.com/users/andaru/gists{/gist_id}","starred_url":"https://api.github.com/users/andaru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andaru/subscriptions","organizations_url":"https://api.github.com/users/andaru/orgs","repos_url":"https://api.github.com/users/andaru/repos","events_url":"https://api.github.com/users/andaru/events{/privacy}","received_events_url":"https://api.github.com/users/andaru/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andaru/goyang","description":"YANG parser and compiler to produce Go language objects","fork":true,"url":"https://api.github.com/repos/andaru/goyang","forks_url":"https://api.github.com/repos/andaru/goyang/forks","keys_url":"https://api.github.com/repos/andaru/goyang/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andaru/goyang/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andaru/goyang/teams","hooks_url":"https://api.github.com/repos/andaru/goyang/hooks","issue_events_url":"https://api.github.com/repos/andaru/goyang/issues/events{/number}","events_url":"https://api.github.com/repos/andaru/goyang/events","assignees_url":"https://api.github.com/repos/andaru/goyang/assignees{/user}","branches_url":"https://api.github.com/repos/andaru/goyang/branches{/branch}","tags_url":"https://api.github.com/repos/andaru/goyang/tags","blobs_url":"https://api.github.com/repos/andaru/goyang/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andaru/goyang/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andaru/goyang/git/refs{/sha}","trees_url":"https://api.github.com/repos/andaru/goyang/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andaru/goyang/statuses/{sha}","languages_url":"https://api.github.com/repos/andaru/goyang/languages","stargazers_url":"https://api.github.com/repos/andaru/goyang/stargazers","contributors_url":"https://api.github.com/repos/andaru/goyang/contributors","subscribers_url":"https://api.github.com/repos/andaru/goyang/subscribers","subscription_url":"https://api.github.com/repos/andaru/goyang/subscription","commits_url":"https://api.github.com/repos/andaru/goyang/commits{/sha}","git_commits_url":"https://api.github.com/repos/andaru/goyang/git/commits{/sha}","comments_url":"https://api.github.com/repos/andaru/goyang/comments{/number}","issue_comment_url":"https://api.github.com/repos/andaru/goyang/issues/comments{/number}","contents_url":"https://api.github.com/repos/andaru/goyang/contents/{+path}","compare_url":"https://api.github.com/repos/andaru/goyang/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andaru/goyang/merges","archive_url":"https://api.github.com/repos/andaru/goyang/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andaru/goyang/downloads","issues_url":"https://api.github.com/repos/andaru/goyang/issues{/number}","pulls_url":"https://api.github.com/repos/andaru/goyang/pulls{/number}","milestones_url":"https://api.github.com/repos/andaru/goyang/milestones{/number}","notifications_url":"https://api.github.com/repos/andaru/goyang/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andaru/goyang/labels{/name}","releases_url":"https://api.github.com/repos/andaru/goyang/releases{/id}","created_at":"2015-11-11T22:07:18Z","updated_at":"2015-11-11T22:07:18Z","pushed_at":"2015-11-12T01:05:27Z","git_url":"git://github.com/andaru/goyang.git","ssh_url":"git@github.com:andaru/goyang.git","clone_url":"https://github.com/andaru/goyang.git","svn_url":"https://github.com/andaru/goyang","homepage":null,"size":199,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openconfig:master","ref":"master","sha":"c7df91413eabc87e861ce25a9060ff55207dd1a4","user":{"login":"openconfig","id":8780263,"avatar_url":"https://avatars.githubusercontent.com/u/8780263?v=3","gravatar_id":"","url":"https://api.github.com/users/openconfig","html_url":"https://github.com/openconfig","followers_url":"https://api.github.com/users/openconfig/followers","following_url":"https://api.github.com/users/openconfig/following{/other_user}","gists_url":"https://api.github.com/users/openconfig/gists{/gist_id}","starred_url":"https://api.github.com/users/openconfig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openconfig/subscriptions","organizations_url":"https://api.github.com/users/openconfig/orgs","repos_url":"https://api.github.com/users/openconfig/repos","events_url":"https://api.github.com/users/openconfig/events{/privacy}","received_events_url":"https://api.github.com/users/openconfig/received_events","type":"Organization","site_admin":false},"repo":{"id":36744413,"name":"goyang","full_name":"openconfig/goyang","owner":{"login":"openconfig","id":8780263,"avatar_url":"https://avatars.githubusercontent.com/u/8780263?v=3","gravatar_id":"","url":"https://api.github.com/users/openconfig","html_url":"https://github.com/openconfig","followers_url":"https://api.github.com/users/openconfig/followers","following_url":"https://api.github.com/users/openconfig/following{/other_user}","gists_url":"https://api.github.com/users/openconfig/gists{/gist_id}","starred_url":"https://api.github.com/users/openconfig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openconfig/subscriptions","organizations_url":"https://api.github.com/users/openconfig/orgs","repos_url":"https://api.github.com/users/openconfig/repos","events_url":"https://api.github.com/users/openconfig/events{/privacy}","received_events_url":"https://api.github.com/users/openconfig/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openconfig/goyang","description":"YANG parser and compiler to produce Go language objects","fork":false,"url":"https://api.github.com/repos/openconfig/goyang","forks_url":"https://api.github.com/repos/openconfig/goyang/forks","keys_url":"https://api.github.com/repos/openconfig/goyang/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openconfig/goyang/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openconfig/goyang/teams","hooks_url":"https://api.github.com/repos/openconfig/goyang/hooks","issue_events_url":"https://api.github.com/repos/openconfig/goyang/issues/events{/number}","events_url":"https://api.github.com/repos/openconfig/goyang/events","assignees_url":"https://api.github.com/repos/openconfig/goyang/assignees{/user}","branches_url":"https://api.github.com/repos/openconfig/goyang/branches{/branch}","tags_url":"https://api.github.com/repos/openconfig/goyang/tags","blobs_url":"https://api.github.com/repos/openconfig/goyang/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openconfig/goyang/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openconfig/goyang/git/refs{/sha}","trees_url":"https://api.github.com/repos/openconfig/goyang/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openconfig/goyang/statuses/{sha}","languages_url":"https://api.github.com/repos/openconfig/goyang/languages","stargazers_url":"https://api.github.com/repos/openconfig/goyang/stargazers","contributors_url":"https://api.github.com/repos/openconfig/goyang/contributors","subscribers_url":"https://api.github.com/repos/openconfig/goyang/subscribers","subscription_url":"https://api.github.com/repos/openconfig/goyang/subscription","commits_url":"https://api.github.com/repos/openconfig/goyang/commits{/sha}","git_commits_url":"https://api.github.com/repos/openconfig/goyang/git/commits{/sha}","comments_url":"https://api.github.com/repos/openconfig/goyang/comments{/number}","issue_comment_url":"https://api.github.com/repos/openconfig/goyang/issues/comments{/number}","contents_url":"https://api.github.com/repos/openconfig/goyang/contents/{+path}","compare_url":"https://api.github.com/repos/openconfig/goyang/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openconfig/goyang/merges","archive_url":"https://api.github.com/repos/openconfig/goyang/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openconfig/goyang/downloads","issues_url":"https://api.github.com/repos/openconfig/goyang/issues{/number}","pulls_url":"https://api.github.com/repos/openconfig/goyang/pulls{/number}","milestones_url":"https://api.github.com/repos/openconfig/goyang/milestones{/number}","notifications_url":"https://api.github.com/repos/openconfig/goyang/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openconfig/goyang/labels{/name}","releases_url":"https://api.github.com/repos/openconfig/goyang/releases{/id}","created_at":"2015-06-02T15:57:01Z","updated_at":"2015-11-01T16:58:02Z","pushed_at":"2015-11-12T01:05:27Z","git_url":"git://github.com/openconfig/goyang.git","ssh_url":"git@github.com:openconfig/goyang.git","clone_url":"https://github.com/openconfig/goyang.git","svn_url":"https://github.com/openconfig/goyang","homepage":null,"size":334,"stargazers_count":8,"watchers_count":8,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":3,"forks":6,"open_issues":3,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openconfig/goyang/pulls/11"},"html":{"href":"https://github.com/openconfig/goyang/pull/11"},"issue":{"href":"https://api.github.com/repos/openconfig/goyang/issues/11"},"comments":{"href":"https://api.github.com/repos/openconfig/goyang/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/openconfig/goyang/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/openconfig/goyang/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openconfig/goyang/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/openconfig/goyang/statuses/7ca4dbbc6724c7c1d3e2552dc9b667d5f02f933d"}}}}