From 5843038a0812cc133c1895b7410aeda7153e8708 Mon Sep 17 00:00:00 2001 From: ᴜɴᴋɴᴡᴏɴ Date: Sat, 21 Mar 2020 13:39:32 +0800 Subject: workflows: enable golangci-lint (#5998) * Create golint.yml * Update golint.yml * Update golint.yml * Fix errcheck * Fix gosimple * Fix staticcheck --- internal/cmd/import.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'internal/cmd/import.go') diff --git a/internal/cmd/import.go b/internal/cmd/import.go index bfc83852..0bfe6c20 100644 --- a/internal/cmd/import.go +++ b/internal/cmd/import.go @@ -61,7 +61,7 @@ func runImportLocale(c *cli.Context) error { now := time.Now() - line := make([]byte, 0, 100) + var line []byte badChars := []byte(`="`) escapedQuotes := []byte(`\"`) regularQuotes := []byte(`"`) @@ -97,15 +97,15 @@ func runImportLocale(c *cli.Context) error { line = append(line[:idx+1], line[idx+2:len(line)-1]...) line = bytes.Replace(line, escapedQuotes, regularQuotes, -1) } - tw.Write(line) - tw.WriteString("\n") + _, _ = tw.Write(line) + _, _ = tw.WriteString("\n") } - sr.Close() - tw.Close() + _ = sr.Close() + _ = tw.Close() // Modification time of files from Crowdin often ahead of current, // so we need to set back to current. - os.Chtimes(target, now, now) + _ = os.Chtimes(target, now, now) } fmt.Println("Locale files has been successfully imported!") -- cgit v1.2.3