From d506a1b198b3965dd031e276bd17b5789984ba01 Mon Sep 17 00:00:00 2001 From: Munish Goyal Date: Sat, 12 Nov 2022 15:29:53 +1100 Subject: [PATCH] Fix lint --- cmd/reminder/main.go | 3 +-- dev_guide.md | 1 + internal/model/calendar.go | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cmd/reminder/main.go b/cmd/reminder/main.go index e022a5d..20cf263 100644 --- a/cmd/reminder/main.go +++ b/cmd/reminder/main.go @@ -21,9 +21,8 @@ func Flow() { utils.PrintError(err) // read and parse the existing data reminderData := *model.ReadDataFile(defaultDataFilePath) - // TEMP START + // initialize Google Calendar model.FetchCalendar() - // TEMP END // print data stats fmt.Println(reminderData.Stats()) // try automatic backup diff --git a/dev_guide.md b/dev_guide.md index b80904e..42bf0b3 100644 --- a/dev_guide.md +++ b/dev_guide.md @@ -8,6 +8,7 @@ - [Format Files](#format-files) - [Linting Code](#linting-code) - [Build and Push the Docker Image](#build-and-push-the-docker-image) + - [Integrating with Google Calendar API](#integrating-with-google-calendar-api) diff --git a/internal/model/calendar.go b/internal/model/calendar.go index 99a0eba..20eb048 100644 --- a/internal/model/calendar.go +++ b/internal/model/calendar.go @@ -69,7 +69,10 @@ func saveToken(path string, token *oauth2.Token) { log.Fatalf("Unable to cache oauth token: %v", err) } defer f.Close() - json.NewEncoder(f).Encode(token) + err = json.NewEncoder(f).Encode(token) + if err != nil { + log.Fatalf("Unable to encode token: %v", err) + } } // Get Calendar Service.