{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/13199","labels_url":"https://api.github.com/repos/golang/go/issues/13199/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/13199/comments","events_url":"https://api.github.com/repos/golang/go/issues/13199/events","html_url":"https://github.com/golang/go/issues/13199","id":116055181,"number":13199,"title":"path/filepath: Dir() returns incorrect result if the path contains a trailing slash","user":{"login":"0xmohit","id":8176079,"avatar_url":"https://avatars.githubusercontent.com/u/8176079?v=3","gravatar_id":"","url":"https://api.github.com/users/0xmohit","html_url":"https://github.com/0xmohit","followers_url":"https://api.github.com/users/0xmohit/followers","following_url":"https://api.github.com/users/0xmohit/following{/other_user}","gists_url":"https://api.github.com/users/0xmohit/gists{/gist_id}","starred_url":"https://api.github.com/users/0xmohit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0xmohit/subscriptions","organizations_url":"https://api.github.com/users/0xmohit/orgs","repos_url":"https://api.github.com/users/0xmohit/repos","events_url":"https://api.github.com/users/0xmohit/events{/privacy}","received_events_url":"https://api.github.com/users/0xmohit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-10T07:45:44Z","updated_at":"2015-11-10T09:01:57Z","closed_at":null,"body":"[filepath.Dir](https://golang.org/pkg/path/filepath/#Dir) returns incorrect result if the specified path contains a trailing slash.  For example, if the input were `/home/`, then `filepath.Dir` and `filepath.Base` return `/home` and `home` respectively.  Playground [link](http://play.golang.org/p/4vjMCjJV-o).\r\n\r\nFollowing is the output of `dirname` and `basename` from GNU coreutils:\r\n\r\n```shell\r\n$ dirname /home\r\n/\r\n$ basename /home\r\nhome\r\n$ dirname /home/\r\n/\r\n$ basename /home/\r\nhome\r\n```\r\n\r\nWhen the input doesn't contain a trailing slash, then the functions yield expected output.\r\n"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/155362420","html_url":"https://github.com/golang/go/issues/13199#issuecomment-155362420","issue_url":"https://api.github.com/repos/golang/go/issues/13199","id":155362420,"user":{"login":"gopherbot","id":8566911,"avatar_url":"https://avatars.githubusercontent.com/u/8566911?v=3","gravatar_id":"","url":"https://api.github.com/users/gopherbot","html_url":"https://github.com/gopherbot","followers_url":"https://api.github.com/users/gopherbot/followers","following_url":"https://api.github.com/users/gopherbot/following{/other_user}","gists_url":"https://api.github.com/users/gopherbot/gists{/gist_id}","starred_url":"https://api.github.com/users/gopherbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gopherbot/subscriptions","organizations_url":"https://api.github.com/users/gopherbot/orgs","repos_url":"https://api.github.com/users/gopherbot/repos","events_url":"https://api.github.com/users/gopherbot/events{/privacy}","received_events_url":"https://api.github.com/users/gopherbot/received_events","type":"User","site_admin":false},"created_at":"2015-11-10T09:01:57Z","updated_at":"2015-11-10T09:01:57Z","body":"CL https://golang.org/cl/16791 mentions this issue."}}