{"action":"created","comment":{"url":"https://api.github.com/repos/mdlayher/netlink/pulls/comments/106981536","pull_request_review_id":27927939,"id":106981536,"diff_hunk":"@@ -346,6 +346,68 @@ func TestUnmarshalAttributes(t *testing.T) {\n \t\t\t\t},\n \t\t\t},\n \t\t},\n+\t\t{","path":"attribute_test.go","position":4,"original_position":4,"commit_id":"9ce4fda12c4f5be8e0fe5e1551e686f82d035c9f","original_commit_id":"9ce4fda12c4f5be8e0fe5e1551e686f82d035c9f","user":{"login":"mdlayher","id":1926905,"avatar_url":"https://avatars0.githubusercontent.com/u/1926905?v=3","gravatar_id":"","url":"https://api.github.com/users/mdlayher","html_url":"https://github.com/mdlayher","followers_url":"https://api.github.com/users/mdlayher/followers","following_url":"https://api.github.com/users/mdlayher/following{/other_user}","gists_url":"https://api.github.com/users/mdlayher/gists{/gist_id}","starred_url":"https://api.github.com/users/mdlayher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdlayher/subscriptions","organizations_url":"https://api.github.com/users/mdlayher/orgs","repos_url":"https://api.github.com/users/mdlayher/repos","events_url":"https://api.github.com/users/mdlayher/events{/privacy}","received_events_url":"https://api.github.com/users/mdlayher/received_events","type":"User","site_admin":false},"body":"Add the same tests in `TestMarshalAttributes`.","created_at":"2017-03-20T18:33:51Z","updated_at":"2017-03-20T18:33:58Z","html_url":"https://github.com/mdlayher/netlink/pull/56#discussion_r106981536","pull_request_url":"https://api.github.com/repos/mdlayher/netlink/pulls/56","_links":{"self":{"href":"https://api.github.com/repos/mdlayher/netlink/pulls/comments/106981536"},"html":{"href":"https://github.com/mdlayher/netlink/pull/56#discussion_r106981536"},"pull_request":{"href":"https://api.github.com/repos/mdlayher/netlink/pulls/56"}}},"pull_request":{"url":"https://api.github.com/repos/mdlayher/netlink/pulls/56","id":111312154,"html_url":"https://github.com/mdlayher/netlink/pull/56","diff_url":"https://github.com/mdlayher/netlink/pull/56.diff","patch_url":"https://github.com/mdlayher/netlink/pull/56.patch","issue_url":"https://api.github.com/repos/mdlayher/netlink/issues/56","number":56,"state":"open","locked":false,"title":"Attribute helpers for nesting, endianness and a mask over .Type","user":{"login":"ti-mo","id":3214460,"avatar_url":"https://avatars3.githubusercontent.com/u/3214460?v=3","gravatar_id":"","url":"https://api.github.com/users/ti-mo","html_url":"https://github.com/ti-mo","followers_url":"https://api.github.com/users/ti-mo/followers","following_url":"https://api.github.com/users/ti-mo/following{/other_user}","gists_url":"https://api.github.com/users/ti-mo/gists{/gist_id}","starred_url":"https://api.github.com/users/ti-mo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ti-mo/subscriptions","organizations_url":"https://api.github.com/users/ti-mo/orgs","repos_url":"https://api.github.com/users/ti-mo/repos","events_url":"https://api.github.com/users/ti-mo/events{/privacy}","received_events_url":"https://api.github.com/users/ti-mo/received_events","type":"User","site_admin":false},"body":"Hi, I've added three helpers to `Attribute` including some tests. These are all exported to allow eg. NetFilter to make use of them, which should be their main purpose IMO. They're not implemented as struct members to avoid having to change (and bloat) the struct.\r\n\r\n- IsNested() - masks leftmost bit\r\n- IsNetByteOrder() - masks second leftmost bit\r\n- GetType() - masks all other bits from the Type\r\n\r\nI have benched using pointer receivers for these, but there was no perceivable performance difference. Let me know what you think!\r\n\r\nT","created_at":"2017-03-17T16:01:06Z","updated_at":"2017-03-20T18:33:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5a7ccd4c6e2cb20a6a9d84e1be12677d294d1389","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mdlayher/netlink/pulls/56/commits","review_comments_url":"https://api.github.com/repos/mdlayher/netlink/pulls/56/comments","review_comment_url":"https://api.github.com/repos/mdlayher/netlink/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mdlayher/netlink/issues/56/comments","statuses_url":"https://api.github.com/repos/mdlayher/netlink/statuses/9ce4fda12c4f5be8e0fe5e1551e686f82d035c9f","head":{"label":"ti-mo:master","ref":"master","sha":"9ce4fda12c4f5be8e0fe5e1551e686f82d035c9f","user":{"login":"ti-mo","id":3214460,"avatar_url":"https://avatars3.githubusercontent.com/u/3214460?v=3","gravatar_id":"","url":"https://api.github.com/users/ti-mo","html_url":"https://github.com/ti-mo","followers_url":"https://api.github.com/users/ti-mo/followers","following_url":"https://api.github.com/users/ti-mo/following{/other_user}","gists_url":"https://api.github.com/users/ti-mo/gists{/gist_id}","starred_url":"https://api.github.com/users/ti-mo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ti-mo/subscriptions","organizations_url":"https://api.github.com/users/ti-mo/orgs","repos_url":"https://api.github.com/users/ti-mo/repos","events_url":"https://api.github.com/users/ti-mo/events{/privacy}","received_events_url":"https://api.github.com/users/ti-mo/received_events","type":"User","site_admin":false},"repo":{"id":83895785,"name":"netlink","full_name":"ti-mo/netlink","owner":{"login":"ti-mo","id":3214460,"avatar_url":"https://avatars3.githubusercontent.com/u/3214460?v=3","gravatar_id":"","url":"https://api.github.com/users/ti-mo","html_url":"https://github.com/ti-mo","followers_url":"https://api.github.com/users/ti-mo/followers","following_url":"https://api.github.com/users/ti-mo/following{/other_user}","gists_url":"https://api.github.com/users/ti-mo/gists{/gist_id}","starred_url":"https://api.github.com/users/ti-mo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ti-mo/subscriptions","organizations_url":"https://api.github.com/users/ti-mo/orgs","repos_url":"https://api.github.com/users/ti-mo/repos","events_url":"https://api.github.com/users/ti-mo/events{/privacy}","received_events_url":"https://api.github.com/users/ti-mo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ti-mo/netlink","description":"Package netlink provides low-level access to Linux netlink sockets. MIT Licensed.","fork":true,"url":"https://api.github.com/repos/ti-mo/netlink","forks_url":"https://api.github.com/repos/ti-mo/netlink/forks","keys_url":"https://api.github.com/repos/ti-mo/netlink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ti-mo/netlink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ti-mo/netlink/teams","hooks_url":"https://api.github.com/repos/ti-mo/netlink/hooks","issue_events_url":"https://api.github.com/repos/ti-mo/netlink/issues/events{/number}","events_url":"https://api.github.com/repos/ti-mo/netlink/events","assignees_url":"https://api.github.com/repos/ti-mo/netlink/assignees{/user}","branches_url":"https://api.github.com/repos/ti-mo/netlink/branches{/branch}","tags_url":"https://api.github.com/repos/ti-mo/netlink/tags","blobs_url":"https://api.github.com/repos/ti-mo/netlink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ti-mo/netlink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ti-mo/netlink/git/refs{/sha}","trees_url":"https://api.github.com/repos/ti-mo/netlink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ti-mo/netlink/statuses/{sha}","languages_url":"https://api.github.com/repos/ti-mo/netlink/languages","stargazers_url":"https://api.github.com/repos/ti-mo/netlink/stargazers","contributors_url":"https://api.github.com/repos/ti-mo/netlink/contributors","subscribers_url":"https://api.github.com/repos/ti-mo/netlink/subscribers","subscription_url":"https://api.github.com/repos/ti-mo/netlink/subscription","commits_url":"https://api.github.com/repos/ti-mo/netlink/commits{/sha}","git_commits_url":"https://api.github.com/repos/ti-mo/netlink/git/commits{/sha}","comments_url":"https://api.github.com/repos/ti-mo/netlink/comments{/number}","issue_comment_url":"https://api.github.com/repos/ti-mo/netlink/issues/comments{/number}","contents_url":"https://api.github.com/repos/ti-mo/netlink/contents/{+path}","compare_url":"https://api.github.com/repos/ti-mo/netlink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ti-mo/netlink/merges","archive_url":"https://api.github.com/repos/ti-mo/netlink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ti-mo/netlink/downloads","issues_url":"https://api.github.com/repos/ti-mo/netlink/issues{/number}","pulls_url":"https://api.github.com/repos/ti-mo/netlink/pulls{/number}","milestones_url":"https://api.github.com/repos/ti-mo/netlink/milestones{/number}","notifications_url":"https://api.github.com/repos/ti-mo/netlink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ti-mo/netlink/labels{/name}","releases_url":"https://api.github.com/repos/ti-mo/netlink/releases{/id}","deployments_url":"https://api.github.com/repos/ti-mo/netlink/deployments","created_at":"2017-03-04T13:36:13Z","updated_at":"2017-03-04T13:36:15Z","pushed_at":"2017-03-20T18:20:33Z","git_url":"git://github.com/ti-mo/netlink.git","ssh_url":"git@github.com:ti-mo/netlink.git","clone_url":"https://github.com/ti-mo/netlink.git","svn_url":"https://github.com/ti-mo/netlink","homepage":null,"size":113,"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":"mdlayher:master","ref":"master","sha":"67e35ef7eff820e726d4f21103ae5a379947643a","user":{"login":"mdlayher","id":1926905,"avatar_url":"https://avatars0.githubusercontent.com/u/1926905?v=3","gravatar_id":"","url":"https://api.github.com/users/mdlayher","html_url":"https://github.com/mdlayher","followers_url":"https://api.github.com/users/mdlayher/followers","following_url":"https://api.github.com/users/mdlayher/following{/other_user}","gists_url":"https://api.github.com/users/mdlayher/gists{/gist_id}","starred_url":"https://api.github.com/users/mdlayher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdlayher/subscriptions","organizations_url":"https://api.github.com/users/mdlayher/orgs","repos_url":"https://api.github.com/users/mdlayher/repos","events_url":"https://api.github.com/users/mdlayher/events{/privacy}","received_events_url":"https://api.github.com/users/mdlayher/received_events","type":"User","site_admin":false},"repo":{"id":76995624,"name":"netlink","full_name":"mdlayher/netlink","owner":{"login":"mdlayher","id":1926905,"avatar_url":"https://avatars0.githubusercontent.com/u/1926905?v=3","gravatar_id":"","url":"https://api.github.com/users/mdlayher","html_url":"https://github.com/mdlayher","followers_url":"https://api.github.com/users/mdlayher/followers","following_url":"https://api.github.com/users/mdlayher/following{/other_user}","gists_url":"https://api.github.com/users/mdlayher/gists{/gist_id}","starred_url":"https://api.github.com/users/mdlayher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdlayher/subscriptions","organizations_url":"https://api.github.com/users/mdlayher/orgs","repos_url":"https://api.github.com/users/mdlayher/repos","events_url":"https://api.github.com/users/mdlayher/events{/privacy}","received_events_url":"https://api.github.com/users/mdlayher/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mdlayher/netlink","description":"Package netlink provides low-level access to Linux netlink sockets. MIT Licensed.","fork":false,"url":"https://api.github.com/repos/mdlayher/netlink","forks_url":"https://api.github.com/repos/mdlayher/netlink/forks","keys_url":"https://api.github.com/repos/mdlayher/netlink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mdlayher/netlink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mdlayher/netlink/teams","hooks_url":"https://api.github.com/repos/mdlayher/netlink/hooks","issue_events_url":"https://api.github.com/repos/mdlayher/netlink/issues/events{/number}","events_url":"https://api.github.com/repos/mdlayher/netlink/events","assignees_url":"https://api.github.com/repos/mdlayher/netlink/assignees{/user}","branches_url":"https://api.github.com/repos/mdlayher/netlink/branches{/branch}","tags_url":"https://api.github.com/repos/mdlayher/netlink/tags","blobs_url":"https://api.github.com/repos/mdlayher/netlink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mdlayher/netlink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mdlayher/netlink/git/refs{/sha}","trees_url":"https://api.github.com/repos/mdlayher/netlink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mdlayher/netlink/statuses/{sha}","languages_url":"https://api.github.com/repos/mdlayher/netlink/languages","stargazers_url":"https://api.github.com/repos/mdlayher/netlink/stargazers","contributors_url":"https://api.github.com/repos/mdlayher/netlink/contributors","subscribers_url":"https://api.github.com/repos/mdlayher/netlink/subscribers","subscription_url":"https://api.github.com/repos/mdlayher/netlink/subscription","commits_url":"https://api.github.com/repos/mdlayher/netlink/commits{/sha}","git_commits_url":"https://api.github.com/repos/mdlayher/netlink/git/commits{/sha}","comments_url":"https://api.github.com/repos/mdlayher/netlink/comments{/number}","issue_comment_url":"https://api.github.com/repos/mdlayher/netlink/issues/comments{/number}","contents_url":"https://api.github.com/repos/mdlayher/netlink/contents/{+path}","compare_url":"https://api.github.com/repos/mdlayher/netlink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mdlayher/netlink/merges","archive_url":"https://api.github.com/repos/mdlayher/netlink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mdlayher/netlink/downloads","issues_url":"https://api.github.com/repos/mdlayher/netlink/issues{/number}","pulls_url":"https://api.github.com/repos/mdlayher/netlink/pulls{/number}","milestones_url":"https://api.github.com/repos/mdlayher/netlink/milestones{/number}","notifications_url":"https://api.github.com/repos/mdlayher/netlink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mdlayher/netlink/labels{/name}","releases_url":"https://api.github.com/repos/mdlayher/netlink/releases{/id}","deployments_url":"https://api.github.com/repos/mdlayher/netlink/deployments","created_at":"2016-12-20T22:13:34Z","updated_at":"2017-03-16T22:06:18Z","pushed_at":"2017-03-20T18:20:34Z","git_url":"git://github.com/mdlayher/netlink.git","ssh_url":"git@github.com:mdlayher/netlink.git","clone_url":"https://github.com/mdlayher/netlink.git","svn_url":"https://github.com/mdlayher/netlink","homepage":null,"size":105,"stargazers_count":115,"watchers_count":115,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":5,"forks":5,"open_issues":5,"watchers":115,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mdlayher/netlink/pulls/56"},"html":{"href":"https://github.com/mdlayher/netlink/pull/56"},"issue":{"href":"https://api.github.com/repos/mdlayher/netlink/issues/56"},"comments":{"href":"https://api.github.com/repos/mdlayher/netlink/issues/56/comments"},"review_comments":{"href":"https://api.github.com/repos/mdlayher/netlink/pulls/56/comments"},"review_comment":{"href":"https://api.github.com/repos/mdlayher/netlink/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mdlayher/netlink/pulls/56/commits"},"statuses":{"href":"https://api.github.com/repos/mdlayher/netlink/statuses/9ce4fda12c4f5be8e0fe5e1551e686f82d035c9f"}}}}
{"actor":{"display_login":"mdlayher"}}