Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.

Commit

Permalink
fixed trimToImportPath for outside of go path (#33)
Browse files Browse the repository at this point in the history
* fixed trimToImportPath for outside of go path

* is this how working_directory works?

* is this how working_directory works?

* is this how working_directory works?

* is THIS how working_directory works?

* is THIS how working_directory works?

* working_directory

* working_directory
  • Loading branch information
steviezhang authored and noot committed May 22, 2019
1 parent 5c3969f commit ca44ce1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: 2
jobs:
build-linux-go-1.12:
working_directory: ~/go-ethereum
docker:
- image: circleci/golang:1.12
steps:
Expand All @@ -16,6 +17,7 @@ jobs:
paths:
- "/go/pkg/mod"
tests-linux-go-1.12:
working_directory: ~/go-ethereum
docker:
- image: circleci/golang:1.12
steps:
Expand Down
6 changes: 6 additions & 0 deletions logger/glog/glog.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,11 @@ var trimPrefixes = []string{
func trimToImportPath(file string) string {
if root := strings.LastIndex(file, "src/"); root != 0 {
file = file[root+3:]
re := regexp.MustCompile(`^.*\bgo-ethereum\b`)
index := re.FindStringIndex(file)
if index != nil {
file = file[index[1]:]
}
}
return file
}
Expand Down Expand Up @@ -796,6 +801,7 @@ func (l *loggingT) header(s severity, depth int) (*buffer, string, int) {
}
file = file[1:] // drop '/'
}

return l.formatHeader(s, file, line), file, line
}

Expand Down

0 comments on commit ca44ce1

Please sign in to comment.