Skip to content

Instantly share code, notes, and snippets.

View maurigamg's full-sized avatar
:shipit:
Focusing

Mauricio Gamboa maurigamg

:shipit:
Focusing
  • San José, Costa Rica
View GitHub Profile
@maurigamg
maurigamg / README.md
Last active April 24, 2025 22:25
Gmail API: Using the gmail pkg for Go

A simple main.go that creates a gmail service to search and download attachments from gmail.

Description

This main.go was created using the gmail package for Golang and following this quickstart guide, which describes how to set up the Gmail API and authenticate with it.

For more information about the Gmail API, you can check out the official documentation.

Scopes

Scopes are required when creating the token because they are used to define the level of access of the application.

@maurigamg
maurigamg / README.md
Last active August 21, 2024 00:03
Sheets API: Using the sheets pkg for Go

A simple main.go that creates a sheets service to append data to a spreadsheet.

Description

This main.go was created using the sheets package for Golang. For more information about the Google Sheets API, you can check out the official documentation.

Authentication

This application uses a service account to authenticate with the Google Sheets API because I found it easier to use. However, if you don't want to use a service account, you can use OAuth2.0 instead, but you will need to change the code to use the OAuth2.0 flow. You can find more information about this in the