{"action":"created","comment":{"url":"https://api.github.com/repos/crossdock/crossdock-go/pulls/comments/73012648","id":73012648,"diff_hunk":"@@ -87,55 +87,96 @@ func ObjectsAreEqualValues(expected, actual interface{}) bool {\n }\n \n /* CallerInfo is necessary because the assert functions use the testing object\n-internally, causing it to print the file:line of the assert method, rather than where\n-the problem actually occured in calling code.*/\n+internally, causing it to print the file:line of the assert method, rather than\n+where the problem actually occurred in calling code.*/\n \n // CallerInfo returns an array of strings containing the file and line number\n-// of each stack frame leading from the current test to the assert call that\n-// failed.\n+// of each stack frame leading from the assert call that failed back to the\n+// current test entry point.\n func CallerInfo() []string {\n+\t// 16 is how many traces we want to collect, its the call stack between\n+\t// CallerInfo and up toward the program entry point. As there is about 7\n+\t// frames above CallerInfo() until the usercode, this leaves about 8 frames\n+\t// for the returned stacktrace. The goal is to provide an informative error\n+\t// msg, not a scrolling game.\n+\tst := make([]uintptr, 16)\n \n-\tpc := uintptr(0)\n-\tfile := \"\"\n-\tline := 0\n-\tok := false\n-\tname := \"\"\n-\n-\tcallers := []string{}\n-\tfor i := 0; ; i++ {\n-\t\tpc, file, line, ok = runtime.Caller(i)\n-\t\tif !ok {\n-\t\t\treturn nil\n+\t// And here we already skip 2 stack frames, the Callers function frame and\n+\t// our own CallerInfo frame.\n+\tstDepth := runtime.Callers(2, st)\n+\n+\tr := []string{}\n+\tstIndex := 0\n+\n+\tconst ourPackage = \"crossdock-go\"\n+\n+\t// We walk up the stack until we are outside our package.\n+\tfor ; stIndex < stDepth; stIndex++ {\n+\t\tpc := st[stIndex]\n+\n+\t\tf := runtime.FuncForPC(pc)\n+\t\tif f == nil { // can't do much without infos.\n+\t\t\tcontinue\n \t\t}\n+\t\tfname := f.Name()\n \n-\t\t// This is a huge edge case, but it will panic if this is the case, see #180\n-\t\tif file == \"<autogenerated>\" {\n-\t\t\tbreak\n+\t\t// Ignoring this.\n+\t\tif fname == \"<autogenerated>\" {\n+\t\t\tcontinue\n \t\t}\n \n-\t\tparts := strings.Split(file, \"/\")\n-\t\tdir := parts[len(parts)-2]\n-\t\tfile = parts[len(parts)-1]\n-\t\tif (dir != \"assert\" && dir != \"mock\" && dir != \"require\") || file == \"mock_test.go\" {\n-\t\t\tcallers = append(callers, fmt.Sprintf(\"%s:%d\", file, line))\n+\t\t// As long as we are in our package, we continue.\n+\t\tif strings.Contains(fname, ourPackage) {","path":"assert/assertions.go","position":null,"original_position":66,"commit_id":"c572d6d35b1c80cd3886c01443a43cd3019388c7","original_commit_id":"295b805f116e7a2acf1651df585aae1dce6e4fc2","user":{"login":"abhinav","id":41730,"avatar_url":"https://avatars.githubusercontent.com/u/41730?v=3","gravatar_id":"","url":"https://api.github.com/users/abhinav","html_url":"https://github.com/abhinav","followers_url":"https://api.github.com/users/abhinav/followers","following_url":"https://api.github.com/users/abhinav/following{/other_user}","gists_url":"https://api.github.com/users/abhinav/gists{/gist_id}","starred_url":"https://api.github.com/users/abhinav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhinav/subscriptions","organizations_url":"https://api.github.com/users/abhinav/orgs","repos_url":"https://api.github.com/users/abhinav/repos","events_url":"https://api.github.com/users/abhinav/events{/privacy}","received_events_url":"https://api.github.com/users/abhinav/received_events","type":"User","site_admin":false},"body":"Isn't this a fairly wide rule? It will also skip anything in my own codebase that's under the folder `my-crossdock-go`. Consider using the full import path of the project.","created_at":"2016-08-01T16:54:43Z","updated_at":"2016-08-01T16:54:43Z","html_url":"https://github.com/crossdock/crossdock-go/pull/9#discussion_r73012648","pull_request_url":"https://api.github.com/repos/crossdock/crossdock-go/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/crossdock/crossdock-go/pulls/comments/73012648"},"html":{"href":"https://github.com/crossdock/crossdock-go/pull/9#discussion_r73012648"},"pull_request":{"href":"https://api.github.com/repos/crossdock/crossdock-go/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/crossdock/crossdock-go/pulls/9","id":79294361,"html_url":"https://github.com/crossdock/crossdock-go/pull/9","diff_url":"https://github.com/crossdock/crossdock-go/pull/9.diff","patch_url":"https://github.com/crossdock/crossdock-go/pull/9.patch","issue_url":"https://api.github.com/repos/crossdock/crossdock-go/issues/9","number":9,"state":"closed","locked":false,"title":"Decent stacktrace.","user":{"login":"bombela","id":216204,"avatar_url":"https://avatars.githubusercontent.com/u/216204?v=3","gravatar_id":"","url":"https://api.github.com/users/bombela","html_url":"https://github.com/bombela","followers_url":"https://api.github.com/users/bombela/followers","following_url":"https://api.github.com/users/bombela/following{/other_user}","gists_url":"https://api.github.com/users/bombela/gists{/gist_id}","starred_url":"https://api.github.com/users/bombela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bombela/subscriptions","organizations_url":"https://api.github.com/users/bombela/orgs","repos_url":"https://api.github.com/users/bombela/repos","events_url":"https://api.github.com/users/bombela/events{/privacy}","received_events_url":"https://api.github.com/users/bombela/received_events","type":"User","site_admin":false},"body":"This PR incorporate the testify library, and adapts it to improves the\nstacktrace output on failed assertions.","created_at":"2016-07-29T01:28:33Z","updated_at":"2016-08-01T16:54:43Z","closed_at":"2016-07-29T23:06:58Z","merged_at":"2016-07-29T23:06:58Z","merge_commit_sha":"5b3f5273a7c3cef93a05bd17854bde4ad2d5c40e","assignee":{"login":"abhinav","id":41730,"avatar_url":"https://avatars.githubusercontent.com/u/41730?v=3","gravatar_id":"","url":"https://api.github.com/users/abhinav","html_url":"https://github.com/abhinav","followers_url":"https://api.github.com/users/abhinav/followers","following_url":"https://api.github.com/users/abhinav/following{/other_user}","gists_url":"https://api.github.com/users/abhinav/gists{/gist_id}","starred_url":"https://api.github.com/users/abhinav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhinav/subscriptions","organizations_url":"https://api.github.com/users/abhinav/orgs","repos_url":"https://api.github.com/users/abhinav/repos","events_url":"https://api.github.com/users/abhinav/events{/privacy}","received_events_url":"https://api.github.com/users/abhinav/received_events","type":"User","site_admin":false},"assignees":[{"login":"abhinav","id":41730,"avatar_url":"https://avatars.githubusercontent.com/u/41730?v=3","gravatar_id":"","url":"https://api.github.com/users/abhinav","html_url":"https://github.com/abhinav","followers_url":"https://api.github.com/users/abhinav/followers","following_url":"https://api.github.com/users/abhinav/following{/other_user}","gists_url":"https://api.github.com/users/abhinav/gists{/gist_id}","starred_url":"https://api.github.com/users/abhinav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhinav/subscriptions","organizations_url":"https://api.github.com/users/abhinav/orgs","repos_url":"https://api.github.com/users/abhinav/repos","events_url":"https://api.github.com/users/abhinav/events{/privacy}","received_events_url":"https://api.github.com/users/abhinav/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/crossdock/crossdock-go/pulls/9/commits","review_comments_url":"https://api.github.com/repos/crossdock/crossdock-go/pulls/9/comments","review_comment_url":"https://api.github.com/repos/crossdock/crossdock-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/crossdock/crossdock-go/issues/9/comments","statuses_url":"https://api.github.com/repos/crossdock/crossdock-go/statuses/c572d6d35b1c80cd3886c01443a43cd3019388c7","head":{"label":"crossdock:givemeloc","ref":"givemeloc","sha":"c572d6d35b1c80cd3886c01443a43cd3019388c7","user":{"login":"crossdock","id":17518762,"avatar_url":"https://avatars.githubusercontent.com/u/17518762?v=3","gravatar_id":"","url":"https://api.github.com/users/crossdock","html_url":"https://github.com/crossdock","followers_url":"https://api.github.com/users/crossdock/followers","following_url":"https://api.github.com/users/crossdock/following{/other_user}","gists_url":"https://api.github.com/users/crossdock/gists{/gist_id}","starred_url":"https://api.github.com/users/crossdock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crossdock/subscriptions","organizations_url":"https://api.github.com/users/crossdock/orgs","repos_url":"https://api.github.com/users/crossdock/repos","events_url":"https://api.github.com/users/crossdock/events{/privacy}","received_events_url":"https://api.github.com/users/crossdock/received_events","type":"Organization","site_admin":false},"repo":{"id":62096326,"name":"crossdock-go","full_name":"crossdock/crossdock-go","owner":{"login":"crossdock","id":17518762,"avatar_url":"https://avatars.githubusercontent.com/u/17518762?v=3","gravatar_id":"","url":"https://api.github.com/users/crossdock","html_url":"https://github.com/crossdock","followers_url":"https://api.github.com/users/crossdock/followers","following_url":"https://api.github.com/users/crossdock/following{/other_user}","gists_url":"https://api.github.com/users/crossdock/gists{/gist_id}","starred_url":"https://api.github.com/users/crossdock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crossdock/subscriptions","organizations_url":"https://api.github.com/users/crossdock/orgs","repos_url":"https://api.github.com/users/crossdock/repos","events_url":"https://api.github.com/users/crossdock/events{/privacy}","received_events_url":"https://api.github.com/users/crossdock/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crossdock/crossdock-go","description":"A Go client for Crossdock","fork":false,"url":"https://api.github.com/repos/crossdock/crossdock-go","forks_url":"https://api.github.com/repos/crossdock/crossdock-go/forks","keys_url":"https://api.github.com/repos/crossdock/crossdock-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crossdock/crossdock-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crossdock/crossdock-go/teams","hooks_url":"https://api.github.com/repos/crossdock/crossdock-go/hooks","issue_events_url":"https://api.github.com/repos/crossdock/crossdock-go/issues/events{/number}","events_url":"https://api.github.com/repos/crossdock/crossdock-go/events","assignees_url":"https://api.github.com/repos/crossdock/crossdock-go/assignees{/user}","branches_url":"https://api.github.com/repos/crossdock/crossdock-go/branches{/branch}","tags_url":"https://api.github.com/repos/crossdock/crossdock-go/tags","blobs_url":"https://api.github.com/repos/crossdock/crossdock-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crossdock/crossdock-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crossdock/crossdock-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/crossdock/crossdock-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crossdock/crossdock-go/statuses/{sha}","languages_url":"https://api.github.com/repos/crossdock/crossdock-go/languages","stargazers_url":"https://api.github.com/repos/crossdock/crossdock-go/stargazers","contributors_url":"https://api.github.com/repos/crossdock/crossdock-go/contributors","subscribers_url":"https://api.github.com/repos/crossdock/crossdock-go/subscribers","subscription_url":"https://api.github.com/repos/crossdock/crossdock-go/subscription","commits_url":"https://api.github.com/repos/crossdock/crossdock-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/crossdock/crossdock-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/crossdock/crossdock-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/crossdock/crossdock-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/crossdock/crossdock-go/contents/{+path}","compare_url":"https://api.github.com/repos/crossdock/crossdock-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crossdock/crossdock-go/merges","archive_url":"https://api.github.com/repos/crossdock/crossdock-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crossdock/crossdock-go/downloads","issues_url":"https://api.github.com/repos/crossdock/crossdock-go/issues{/number}","pulls_url":"https://api.github.com/repos/crossdock/crossdock-go/pulls{/number}","milestones_url":"https://api.github.com/repos/crossdock/crossdock-go/milestones{/number}","notifications_url":"https://api.github.com/repos/crossdock/crossdock-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crossdock/crossdock-go/labels{/name}","releases_url":"https://api.github.com/repos/crossdock/crossdock-go/releases{/id}","deployments_url":"https://api.github.com/repos/crossdock/crossdock-go/deployments","created_at":"2016-06-27T23:59:33Z","updated_at":"2016-06-28T02:39:35Z","pushed_at":"2016-08-01T16:48:24Z","git_url":"git://github.com/crossdock/crossdock-go.git","ssh_url":"git@github.com:crossdock/crossdock-go.git","clone_url":"https://github.com/crossdock/crossdock-go.git","svn_url":"https://github.com/crossdock/crossdock-go","homepage":null,"size":59,"stargazers_count":2,"watchers_count":2,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":2,"default_branch":"master"}},"base":{"label":"crossdock:master","ref":"master","sha":"9a20d202853d1322cb1d440821ff60dcebfb9323","user":{"login":"crossdock","id":17518762,"avatar_url":"https://avatars.githubusercontent.com/u/17518762?v=3","gravatar_id":"","url":"https://api.github.com/users/crossdock","html_url":"https://github.com/crossdock","followers_url":"https://api.github.com/users/crossdock/followers","following_url":"https://api.github.com/users/crossdock/following{/other_user}","gists_url":"https://api.github.com/users/crossdock/gists{/gist_id}","starred_url":"https://api.github.com/users/crossdock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crossdock/subscriptions","organizations_url":"https://api.github.com/users/crossdock/orgs","repos_url":"https://api.github.com/users/crossdock/repos","events_url":"https://api.github.com/users/crossdock/events{/privacy}","received_events_url":"https://api.github.com/users/crossdock/received_events","type":"Organization","site_admin":false},"repo":{"id":62096326,"name":"crossdock-go","full_name":"crossdock/crossdock-go","owner":{"login":"crossdock","id":17518762,"avatar_url":"https://avatars.githubusercontent.com/u/17518762?v=3","gravatar_id":"","url":"https://api.github.com/users/crossdock","html_url":"https://github.com/crossdock","followers_url":"https://api.github.com/users/crossdock/followers","following_url":"https://api.github.com/users/crossdock/following{/other_user}","gists_url":"https://api.github.com/users/crossdock/gists{/gist_id}","starred_url":"https://api.github.com/users/crossdock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crossdock/subscriptions","organizations_url":"https://api.github.com/users/crossdock/orgs","repos_url":"https://api.github.com/users/crossdock/repos","events_url":"https://api.github.com/users/crossdock/events{/privacy}","received_events_url":"https://api.github.com/users/crossdock/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crossdock/crossdock-go","description":"A Go client for Crossdock","fork":false,"url":"https://api.github.com/repos/crossdock/crossdock-go","forks_url":"https://api.github.com/repos/crossdock/crossdock-go/forks","keys_url":"https://api.github.com/repos/crossdock/crossdock-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crossdock/crossdock-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crossdock/crossdock-go/teams","hooks_url":"https://api.github.com/repos/crossdock/crossdock-go/hooks","issue_events_url":"https://api.github.com/repos/crossdock/crossdock-go/issues/events{/number}","events_url":"https://api.github.com/repos/crossdock/crossdock-go/events","assignees_url":"https://api.github.com/repos/crossdock/crossdock-go/assignees{/user}","branches_url":"https://api.github.com/repos/crossdock/crossdock-go/branches{/branch}","tags_url":"https://api.github.com/repos/crossdock/crossdock-go/tags","blobs_url":"https://api.github.com/repos/crossdock/crossdock-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crossdock/crossdock-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crossdock/crossdock-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/crossdock/crossdock-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crossdock/crossdock-go/statuses/{sha}","languages_url":"https://api.github.com/repos/crossdock/crossdock-go/languages","stargazers_url":"https://api.github.com/repos/crossdock/crossdock-go/stargazers","contributors_url":"https://api.github.com/repos/crossdock/crossdock-go/contributors","subscribers_url":"https://api.github.com/repos/crossdock/crossdock-go/subscribers","subscription_url":"https://api.github.com/repos/crossdock/crossdock-go/subscription","commits_url":"https://api.github.com/repos/crossdock/crossdock-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/crossdock/crossdock-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/crossdock/crossdock-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/crossdock/crossdock-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/crossdock/crossdock-go/contents/{+path}","compare_url":"https://api.github.com/repos/crossdock/crossdock-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crossdock/crossdock-go/merges","archive_url":"https://api.github.com/repos/crossdock/crossdock-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crossdock/crossdock-go/downloads","issues_url":"https://api.github.com/repos/crossdock/crossdock-go/issues{/number}","pulls_url":"https://api.github.com/repos/crossdock/crossdock-go/pulls{/number}","milestones_url":"https://api.github.com/repos/crossdock/crossdock-go/milestones{/number}","notifications_url":"https://api.github.com/repos/crossdock/crossdock-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crossdock/crossdock-go/labels{/name}","releases_url":"https://api.github.com/repos/crossdock/crossdock-go/releases{/id}","deployments_url":"https://api.github.com/repos/crossdock/crossdock-go/deployments","created_at":"2016-06-27T23:59:33Z","updated_at":"2016-06-28T02:39:35Z","pushed_at":"2016-08-01T16:48:24Z","git_url":"git://github.com/crossdock/crossdock-go.git","ssh_url":"git@github.com:crossdock/crossdock-go.git","clone_url":"https://github.com/crossdock/crossdock-go.git","svn_url":"https://github.com/crossdock/crossdock-go","homepage":null,"size":59,"stargazers_count":2,"watchers_count":2,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crossdock/crossdock-go/pulls/9"},"html":{"href":"https://github.com/crossdock/crossdock-go/pull/9"},"issue":{"href":"https://api.github.com/repos/crossdock/crossdock-go/issues/9"},"comments":{"href":"https://api.github.com/repos/crossdock/crossdock-go/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/crossdock/crossdock-go/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/crossdock/crossdock-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/crossdock/crossdock-go/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/crossdock/crossdock-go/statuses/c572d6d35b1c80cd3886c01443a43cd3019388c7"}}}}
{"actor":{"display_login":"abhinav"}}