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>
This commit is contained in:
Iskander (Alex) Sharipov 2019-02-02 10:19:12 +03:00 committed by Bjørn Erik Pedersen
parent 7201042946
commit 483cf19d5d

View file

@ -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 {