commit 483cf19d5de05e8a83fd1be6934baa169c7fd7c8
parent 7201042946dde78d5ea4fea9cb006fb4dded55c1
Author: Iskander (Alex) Sharipov <quasilyte@gmail.com>
Date: Sat, 2 Feb 2019 10:19:12 +0300
common/herrors: Fix args order in strings.TrimPrefix
Old code always returned "." or "" (if filepath.Ext(filename) returned ".").
Now it properly trims the prefix.
Signed-off-by: Iskander Sharipov <quasilyte@gmail.com>
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/herrors/error_locator.go b/common/herrors/error_locator.go
@@ -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 {