aboutsummaryrefslogtreecommitdiff
path: root/internal/cmd/import.go
diff options
context:
space:
mode:
authorᴜɴᴋɴᴡᴏɴ <u@gogs.io>2020-03-21 13:39:32 +0800
committerGitHub <noreply@github.com>2020-03-21 13:39:32 +0800
commit5843038a0812cc133c1895b7410aeda7153e8708 (patch)
tree3515998242443e1a82217ee4702603819c5315c8 /internal/cmd/import.go
parent958d8b6bb4c2da66859325695b91d871e567a4fa (diff)
workflows: enable golangci-lint (#5998)
* Create golint.yml * Update golint.yml * Update golint.yml * Fix errcheck * Fix gosimple * Fix staticcheck
Diffstat (limited to 'internal/cmd/import.go')
-rw-r--r--internal/cmd/import.go12
1 files changed, 6 insertions, 6 deletions
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!")