Skip to content

Commit

Permalink
update error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
plainbanana committed Jun 20, 2020
1 parent 63cee23 commit 424f7a3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func init() {
Scopes: "read write follow",
Website: mastodonAppWebsite,
})
if err != nil {
if !errors.Is(err, nil) {
log.Fatal(err)
}
fmt.Printf("For example, you can use following environments\n")
Expand Down Expand Up @@ -166,7 +166,7 @@ func toot(text string, settings tootConfig) {
ClientSecret: mastodonClientSecret,
})
err := c.Authenticate(context.Background(), mastodonAppYourEmail, mastodonAppYourPassword)
if err != nil {
if !errors.Is(err, nil) {
log.Fatal(err)
}

Expand Down Expand Up @@ -249,7 +249,7 @@ func getFromSpla2API(uri string) splatoonRespSchedules {

func storeRespToFile(b splatoonRespSchedules) {
f, err := os.Create(chacheFile)
if err != nil {
if !errors.Is(err, nil) {
log.Fatal(err)
}
defer f.Close()
Expand All @@ -261,7 +261,7 @@ func storeRespToFile(b splatoonRespSchedules) {

func restoreRespFromFile() splatoonRespSchedules {
f, err := os.Open(chacheFile)
if err != nil {
if !errors.Is(err, nil) {
return splatoonRespSchedules{}
}
defer f.Close()
Expand Down

0 comments on commit 424f7a3

Please sign in to comment.