golint & go vet

This commit is contained in:
Yasuhiro Matsumoto 2017-04-16 23:38:53 +09:00
parent e1b7bac4e6
commit 70b6261e34
6 changed files with 9 additions and 7 deletions

View file

@ -54,7 +54,7 @@ func textContent(s string) string {
}
var (
readUsername func() (string, error) = func() (string, error) {
readUsername = func() (string, error) {
b, _, err := bufio.NewReader(os.Stdin).ReadLine()
if err != nil {
return "", err
@ -134,11 +134,11 @@ func authenticate(client *mastodon.Client, config *mastodon.Config, file string)
}
b, err := json.MarshalIndent(config, "", " ")
if err != nil {
return fmt.Errorf("failed to store file:", err)
return fmt.Errorf("failed to store file: %v", err)
}
err = ioutil.WriteFile(file, b, 0700)
if err != nil {
return fmt.Errorf("failed to store file:", err)
return fmt.Errorf("failed to store file: %v", err)
}
return nil
}