We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 115d1f9 commit 2cef961Copy full SHA for 2cef961
glog_flags.go
@@ -192,9 +192,7 @@ func (f *verboseFlags) levelForPC(pc uintptr) Level {
192
file, _ := fn.FileLine(pc)
193
// The file is something like /a/b/c/d.go. We want just the d for
194
// regular matches, /a/b/c/d for full matches.
195
- if strings.HasSuffix(file, ".go") {
196
- file = file[:len(file)-3]
197
- }
+ file = strings.TrimSuffix(file, ".go")
198
full := file
199
if slash := strings.LastIndex(file, "/"); slash >= 0 {
200
file = file[slash+1:]
0 commit comments