{"action":"created","comment":{"url":"https://api.github.com/repos/containous/yaegi/pulls/comments/308874130","pull_request_review_id":268583058,"id":308874130,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMwODg3NDEzMA==","diff_hunk":"@@ -258,15 +269,59 @@ func fixConst(name string, val constant.Value) string {\n \treturn name\n }\n \n+// genLicense generates the correct LICENSE header text from the provided\n+// path to a LICENSE file.\n+func genLicense(fname string) (string, error) {\n+\tif fname == \"\" {\n+\t\treturn \"\", nil\n+\t}\n+\n+\traw, err := ioutil.ReadFile(fname)\n+\tif err != nil {\n+\t\treturn \"\", fmt.Errorf(\"could not read LICENSE file content: %v\", err)\n+\t}\n+\n+\tlicense := new(strings.Builder)\n+\tsc := bufio.NewScanner(bytes.NewReader(raw))","path":"cmd/goexports/goexports.go","position":100,"original_position":100,"commit_id":"0a05d283b3c49592b09ec6793441f86f4888a2cf","original_commit_id":"0a05d283b3c49592b09ec6793441f86f4888a2cf","user":{"login":"ldez","id":5674651,"node_id":"MDQ6VXNlcjU2NzQ2NTE=","avatar_url":"https://avatars0.githubusercontent.com/u/5674651?v=4","gravatar_id":"","url":"https://api.github.com/users/ldez","html_url":"https://github.com/ldez","followers_url":"https://api.github.com/users/ldez/followers","following_url":"https://api.github.com/users/ldez/following{/other_user}","gists_url":"https://api.github.com/users/ldez/gists{/gist_id}","starred_url":"https://api.github.com/users/ldez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldez/subscriptions","organizations_url":"https://api.github.com/users/ldez/orgs","repos_url":"https://api.github.com/users/ldez/repos","events_url":"https://api.github.com/users/ldez/events{/privacy}","received_events_url":"https://api.github.com/users/ldez/received_events","type":"User","site_admin":false},"body":"as the file content is only used in the scanner, it's possible to simplify:\r\n```go\r\n\tfile, err := os.Open(fname)\r\n\tif err != nil {\r\n\t\treturn \"\", fmt.Errorf(\"could not open LICENSE file: %v\", err)\r\n\t}\r\n\tdefer file.Close()\r\n\r\n\tlicense := new(strings.Builder)\r\n\tsc := bufio.NewScanner(file)\r\n```","created_at":"2019-07-30T18:27:23Z","updated_at":"2019-07-30T18:37:16Z","html_url":"https://github.com/containous/yaegi/pull/311#discussion_r308874130","pull_request_url":"https://api.github.com/repos/containous/yaegi/pulls/311","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/containous/yaegi/pulls/comments/308874130"},"html":{"href":"https://github.com/containous/yaegi/pull/311#discussion_r308874130"},"pull_request":{"href":"https://api.github.com/repos/containous/yaegi/pulls/311"}}},"pull_request":{"url":"https://api.github.com/repos/containous/yaegi/pulls/311","id":302401508,"node_id":"MDExOlB1bGxSZXF1ZXN0MzAyNDAxNTA4","html_url":"https://github.com/containous/yaegi/pull/311","diff_url":"https://github.com/containous/yaegi/pull/311.diff","patch_url":"https://github.com/containous/yaegi/pull/311.patch","issue_url":"https://api.github.com/repos/containous/yaegi/issues/311","number":311,"state":"open","locked":false,"title":"cmd/goexports: add -license flag to goexports","user":{"login":"sbinet","id":1070920,"node_id":"MDQ6VXNlcjEwNzA5MjA=","avatar_url":"https://avatars2.githubusercontent.com/u/1070920?v=4","gravatar_id":"","url":"https://api.github.com/users/sbinet","html_url":"https://github.com/sbinet","followers_url":"https://api.github.com/users/sbinet/followers","following_url":"https://api.github.com/users/sbinet/following{/other_user}","gists_url":"https://api.github.com/users/sbinet/gists{/gist_id}","starred_url":"https://api.github.com/users/sbinet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbinet/subscriptions","organizations_url":"https://api.github.com/users/sbinet/orgs","repos_url":"https://api.github.com/users/sbinet/repos","events_url":"https://api.github.com/users/sbinet/events{/privacy}","received_events_url":"https://api.github.com/users/sbinet/received_events","type":"User","site_admin":false},"body":"Fixes #310.","created_at":"2019-07-30T09:08:49Z","updated_at":"2019-07-30T18:37:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ca119d89943aa1a252956753391b8dae31563752","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1469819939,"node_id":"MDU6TGFiZWwxNDY5ODE5OTM5","url":"https://api.github.com/repos/containous/yaegi/labels/area/goexports","name":"area/goexports","color":"d9e271","default":false},{"id":800376192,"node_id":"MDU6TGFiZWw4MDAzNzYxOTI=","url":"https://api.github.com/repos/containous/yaegi/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/containous/yaegi/pulls/311/commits","review_comments_url":"https://api.github.com/repos/containous/yaegi/pulls/311/comments","review_comment_url":"https://api.github.com/repos/containous/yaegi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/containous/yaegi/issues/311/comments","statuses_url":"https://api.github.com/repos/containous/yaegi/statuses/0a05d283b3c49592b09ec6793441f86f4888a2cf","head":{"label":"sbinet-gonum:goexports-template","ref":"goexports-template","sha":"0a05d283b3c49592b09ec6793441f86f4888a2cf","user":{"login":"sbinet-gonum","id":24896421,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0ODk2NDIx","avatar_url":"https://avatars1.githubusercontent.com/u/24896421?v=4","gravatar_id":"","url":"https://api.github.com/users/sbinet-gonum","html_url":"https://github.com/sbinet-gonum","followers_url":"https://api.github.com/users/sbinet-gonum/followers","following_url":"https://api.github.com/users/sbinet-gonum/following{/other_user}","gists_url":"https://api.github.com/users/sbinet-gonum/gists{/gist_id}","starred_url":"https://api.github.com/users/sbinet-gonum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbinet-gonum/subscriptions","organizations_url":"https://api.github.com/users/sbinet-gonum/orgs","repos_url":"https://api.github.com/users/sbinet-gonum/repos","events_url":"https://api.github.com/users/sbinet-gonum/events{/privacy}","received_events_url":"https://api.github.com/users/sbinet-gonum/received_events","type":"Organization","site_admin":false},"repo":{"id":199604086,"node_id":"MDEwOlJlcG9zaXRvcnkxOTk2MDQwODY=","name":"yaegi","full_name":"sbinet-gonum/yaegi","private":false,"owner":{"login":"sbinet-gonum","id":24896421,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0ODk2NDIx","avatar_url":"https://avatars1.githubusercontent.com/u/24896421?v=4","gravatar_id":"","url":"https://api.github.com/users/sbinet-gonum","html_url":"https://github.com/sbinet-gonum","followers_url":"https://api.github.com/users/sbinet-gonum/followers","following_url":"https://api.github.com/users/sbinet-gonum/following{/other_user}","gists_url":"https://api.github.com/users/sbinet-gonum/gists{/gist_id}","starred_url":"https://api.github.com/users/sbinet-gonum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbinet-gonum/subscriptions","organizations_url":"https://api.github.com/users/sbinet-gonum/orgs","repos_url":"https://api.github.com/users/sbinet-gonum/repos","events_url":"https://api.github.com/users/sbinet-gonum/events{/privacy}","received_events_url":"https://api.github.com/users/sbinet-gonum/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/sbinet-gonum/yaegi","description":"Yaegi is Another Elegant Go Interpreter","fork":true,"url":"https://api.github.com/repos/sbinet-gonum/yaegi","forks_url":"https://api.github.com/repos/sbinet-gonum/yaegi/forks","keys_url":"https://api.github.com/repos/sbinet-gonum/yaegi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sbinet-gonum/yaegi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sbinet-gonum/yaegi/teams","hooks_url":"https://api.github.com/repos/sbinet-gonum/yaegi/hooks","issue_events_url":"https://api.github.com/repos/sbinet-gonum/yaegi/issues/events{/number}","events_url":"https://api.github.com/repos/sbinet-gonum/yaegi/events","assignees_url":"https://api.github.com/repos/sbinet-gonum/yaegi/assignees{/user}","branches_url":"https://api.github.com/repos/sbinet-gonum/yaegi/branches{/branch}","tags_url":"https://api.github.com/repos/sbinet-gonum/yaegi/tags","blobs_url":"https://api.github.com/repos/sbinet-gonum/yaegi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sbinet-gonum/yaegi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sbinet-gonum/yaegi/git/refs{/sha}","trees_url":"https://api.github.com/repos/sbinet-gonum/yaegi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sbinet-gonum/yaegi/statuses/{sha}","languages_url":"https://api.github.com/repos/sbinet-gonum/yaegi/languages","stargazers_url":"https://api.github.com/repos/sbinet-gonum/yaegi/stargazers","contributors_url":"https://api.github.com/repos/sbinet-gonum/yaegi/contributors","subscribers_url":"https://api.github.com/repos/sbinet-gonum/yaegi/subscribers","subscription_url":"https://api.github.com/repos/sbinet-gonum/yaegi/subscription","commits_url":"https://api.github.com/repos/sbinet-gonum/yaegi/commits{/sha}","git_commits_url":"https://api.github.com/repos/sbinet-gonum/yaegi/git/commits{/sha}","comments_url":"https://api.github.com/repos/sbinet-gonum/yaegi/comments{/number}","issue_comment_url":"https://api.github.com/repos/sbinet-gonum/yaegi/issues/comments{/number}","contents_url":"https://api.github.com/repos/sbinet-gonum/yaegi/contents/{+path}","compare_url":"https://api.github.com/repos/sbinet-gonum/yaegi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sbinet-gonum/yaegi/merges","archive_url":"https://api.github.com/repos/sbinet-gonum/yaegi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sbinet-gonum/yaegi/downloads","issues_url":"https://api.github.com/repos/sbinet-gonum/yaegi/issues{/number}","pulls_url":"https://api.github.com/repos/sbinet-gonum/yaegi/pulls{/number}","milestones_url":"https://api.github.com/repos/sbinet-gonum/yaegi/milestones{/number}","notifications_url":"https://api.github.com/repos/sbinet-gonum/yaegi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sbinet-gonum/yaegi/labels{/name}","releases_url":"https://api.github.com/repos/sbinet-gonum/yaegi/releases{/id}","deployments_url":"https://api.github.com/repos/sbinet-gonum/yaegi/deployments","created_at":"2019-07-30T07:58:53Z","updated_at":"2019-07-30T15:17:22Z","pushed_at":"2019-07-30T15:30:22Z","git_url":"git://github.com/sbinet-gonum/yaegi.git","ssh_url":"git@github.com:sbinet-gonum/yaegi.git","clone_url":"https://github.com/sbinet-gonum/yaegi.git","svn_url":"https://github.com/sbinet-gonum/yaegi","homepage":"https://godoc.org/github.com/containous/yaegi","size":25429,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"containous:master","ref":"master","sha":"5bf6618a53ea208fed9c8b293eee1a0c59a988dd","user":{"login":"containous","id":16349663,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MzQ5NjYz","avatar_url":"https://avatars3.githubusercontent.com/u/16349663?v=4","gravatar_id":"","url":"https://api.github.com/users/containous","html_url":"https://github.com/containous","followers_url":"https://api.github.com/users/containous/followers","following_url":"https://api.github.com/users/containous/following{/other_user}","gists_url":"https://api.github.com/users/containous/gists{/gist_id}","starred_url":"https://api.github.com/users/containous/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/containous/subscriptions","organizations_url":"https://api.github.com/users/containous/orgs","repos_url":"https://api.github.com/users/containous/repos","events_url":"https://api.github.com/users/containous/events{/privacy}","received_events_url":"https://api.github.com/users/containous/received_events","type":"Organization","site_admin":false},"repo":{"id":116938442,"node_id":"MDEwOlJlcG9zaXRvcnkxMTY5Mzg0NDI=","name":"yaegi","full_name":"containous/yaegi","private":false,"owner":{"login":"containous","id":16349663,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MzQ5NjYz","avatar_url":"https://avatars3.githubusercontent.com/u/16349663?v=4","gravatar_id":"","url":"https://api.github.com/users/containous","html_url":"https://github.com/containous","followers_url":"https://api.github.com/users/containous/followers","following_url":"https://api.github.com/users/containous/following{/other_user}","gists_url":"https://api.github.com/users/containous/gists{/gist_id}","starred_url":"https://api.github.com/users/containous/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/containous/subscriptions","organizations_url":"https://api.github.com/users/containous/orgs","repos_url":"https://api.github.com/users/containous/repos","events_url":"https://api.github.com/users/containous/events{/privacy}","received_events_url":"https://api.github.com/users/containous/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/containous/yaegi","description":"Yaegi is Another Elegant Go Interpreter","fork":false,"url":"https://api.github.com/repos/containous/yaegi","forks_url":"https://api.github.com/repos/containous/yaegi/forks","keys_url":"https://api.github.com/repos/containous/yaegi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/containous/yaegi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/containous/yaegi/teams","hooks_url":"https://api.github.com/repos/containous/yaegi/hooks","issue_events_url":"https://api.github.com/repos/containous/yaegi/issues/events{/number}","events_url":"https://api.github.com/repos/containous/yaegi/events","assignees_url":"https://api.github.com/repos/containous/yaegi/assignees{/user}","branches_url":"https://api.github.com/repos/containous/yaegi/branches{/branch}","tags_url":"https://api.github.com/repos/containous/yaegi/tags","blobs_url":"https://api.github.com/repos/containous/yaegi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/containous/yaegi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/containous/yaegi/git/refs{/sha}","trees_url":"https://api.github.com/repos/containous/yaegi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/containous/yaegi/statuses/{sha}","languages_url":"https://api.github.com/repos/containous/yaegi/languages","stargazers_url":"https://api.github.com/repos/containous/yaegi/stargazers","contributors_url":"https://api.github.com/repos/containous/yaegi/contributors","subscribers_url":"https://api.github.com/repos/containous/yaegi/subscribers","subscription_url":"https://api.github.com/repos/containous/yaegi/subscription","commits_url":"https://api.github.com/repos/containous/yaegi/commits{/sha}","git_commits_url":"https://api.github.com/repos/containous/yaegi/git/commits{/sha}","comments_url":"https://api.github.com/repos/containous/yaegi/comments{/number}","issue_comment_url":"https://api.github.com/repos/containous/yaegi/issues/comments{/number}","contents_url":"https://api.github.com/repos/containous/yaegi/contents/{+path}","compare_url":"https://api.github.com/repos/containous/yaegi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/containous/yaegi/merges","archive_url":"https://api.github.com/repos/containous/yaegi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/containous/yaegi/downloads","issues_url":"https://api.github.com/repos/containous/yaegi/issues{/number}","pulls_url":"https://api.github.com/repos/containous/yaegi/pulls{/number}","milestones_url":"https://api.github.com/repos/containous/yaegi/milestones{/number}","notifications_url":"https://api.github.com/repos/containous/yaegi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/containous/yaegi/labels{/name}","releases_url":"https://api.github.com/repos/containous/yaegi/releases{/id}","deployments_url":"https://api.github.com/repos/containous/yaegi/deployments","created_at":"2018-01-10T09:39:30Z","updated_at":"2019-07-30T18:00:09Z","pushed_at":"2019-07-30T18:34:29Z","git_url":"git://github.com/containous/yaegi.git","ssh_url":"git@github.com:containous/yaegi.git","clone_url":"https://github.com/containous/yaegi.git","svn_url":"https://github.com/containous/yaegi","homepage":"https://godoc.org/github.com/containous/yaegi","size":25391,"stargazers_count":1592,"watchers_count":1592,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":45,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":47,"open_issues":45,"watchers":1592,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/containous/yaegi/pulls/311"},"html":{"href":"https://github.com/containous/yaegi/pull/311"},"issue":{"href":"https://api.github.com/repos/containous/yaegi/issues/311"},"comments":{"href":"https://api.github.com/repos/containous/yaegi/issues/311/comments"},"review_comments":{"href":"https://api.github.com/repos/containous/yaegi/pulls/311/comments"},"review_comment":{"href":"https://api.github.com/repos/containous/yaegi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/containous/yaegi/pulls/311/commits"},"statuses":{"href":"https://api.github.com/repos/containous/yaegi/statuses/0a05d283b3c49592b09ec6793441f86f4888a2cf"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ldez"}}