Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use forward slashes for TrimmedPath() instead of os.PathSeparator
Go stdlib runtime.Caller() currently returns forward slashes on Windows (see golang/go#3335) which causes EntryCaller.TrimmedPath() to return full paths instead of the expected trimmed paths on Windows. This is because EntryCaller.TrimmedPath() uses os.PathSeparator to trim the path which is '\' on Windows. According to the discussion on the Go bug, it seems like os.PathSeparator might be '' in some cases on Unix too so might cause issues on non-Windows platforms too. This PR replaces the two occurrences of os.PathSeparator with ''/' as that is what runtime.Caller() currently produces on all platforms. Fixes: uber-go#382 See also: golango/go#18151
- Loading branch information