Skip to content

Commit

Permalink
common/herrors: Fix args order in strings.TrimPrefix
Browse files Browse the repository at this point in the history
Old code always returned "." or "" (if filepath.Ext(filename) returned ".").
Now it properly trims the prefix.

Signed-off-by: Iskander Sharipov <[email protected]>
  • Loading branch information
quasilyte authored and bep committed Feb 2, 2019
1 parent 7201042 commit 483cf19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/herrors/error_locator.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func chromaLexerFromType(fileType string) string {
}

func extNoDelimiter(filename string) string {
return strings.TrimPrefix(".", filepath.Ext(filename))
return strings.TrimPrefix(filepath.Ext(filename), ".")
}

func chromaLexerFromFilename(filename string) string {
Expand Down

0 comments on commit 483cf19

Please sign in to comment.