From: Iskander (Alex) Sharipov Date: Sat, 2 Feb 2019 07:19:12 +0000 (+0300) Subject: common/herrors: Fix args order in strings.TrimPrefix X-Git-Tag: v0.55.0~64 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=483cf19d5de05e8a83fd1be6934baa169c7fd7c8;p=brevno-suite%2Fhugo 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 --- diff --git a/common/herrors/error_locator.go b/common/herrors/error_locator.go index 3a72f479..15de6d31 100644 --- 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 {