diff --git a/credentials.json.example b/creds/credentials.json.example similarity index 100% rename from credentials.json.example rename to creds/credentials.json.example diff --git a/token.json.example b/creds/token.json.example similarity index 100% rename from token.json.example rename to creds/token.json.example diff --git a/main.go b/main.go index 0fe105a..1476155 100644 --- a/main.go +++ b/main.go @@ -14,8 +14,11 @@ import ( "google.golang.org/api/option" ) +const TOKEN_FILE string = "creds/token.json" +const CREDENTIALS_FILE string = "creds/credentials.json" + func getClient(config *oauth2.Config) *http.Client { - token_file := "token.json" + token_file := TOKEN_FILE token, err := tokenFromFile(token_file) if err != nil { token = getTokenFromWeb(config) @@ -64,7 +67,7 @@ func saveToken(path string, token *oauth2.Token) { func main() { ctx := context.Background() - creds_b, err := os.ReadFile("credentials.json") + creds_b, err := os.ReadFile(CREDENTIALS_FILE) if err != nil { log.Fatalf("Unable to read client secret file: %v", err) }