Applied suggested linter changes

This commit is contained in:
2018-04-26 01:14:23 +02:00
parent a45c39a916
commit e90873b64f
13 changed files with 42 additions and 79 deletions

View File

@ -101,7 +101,7 @@ func main() {
}
character.Description = strings.Join(finalLines, "\n\n")
character.Description = strings.Trim(character.Description, "\n\n")
character.Description = strings.Trim(character.Description, "\n")
character.Save()
// Save Kitsu character in Kitsu DB

View File

@ -1,7 +1,6 @@
package main
import (
"encoding/json"
"errors"
"fmt"
"os"
@ -47,13 +46,13 @@ func main() {
func readFile(name string) error {
file, err := os.Open(name)
defer file.Close()
if err != nil {
fmt.Println(err)
return err
}
defer file.Close()
anime, characters, err := malparser.ParseAnime(file)
if err != nil {
@ -95,9 +94,3 @@ func readFile(name string) error {
arn.MAL.Set("Anime", anime.ID, anime)
return nil
}
// prettyPrint prints the object as indented JSON data on the console.
func prettyPrint(obj interface{}) {
pretty, _ := json.MarshalIndent(obj, "", "\t")
fmt.Println(string(pretty))
}