This document is a collection of all onboarding-related information, tips & tricks, etc. for first-time SDK contributors.
The internet contains a plethora of learning resources for the Go language. Below are sources that we find useful:
- Go Get Started Guide
- Also lists additional learning resources.
- Pluralsight (License Required)
- We recommend the Getting Started With Go course for an excellent guide to setting up your local development environment.
- Go by Example
- Ideal for those who learn best by doing.
- The Go Playground
- Sandbox for playing with Go code.
- Go Docs
- Landing page for many Go resources e.g. learning, concepts, etc.
- Effective Go
- Outlines community-accepted code style and best practices.
- Our Go Guide
- Best practices and code style our team adheres to.
Below is a breakdown of the setup:
- Install Go - download
- Install Git - download
- Install Visual Studio Code - download
- Set up Git access for your machine
- Use a Git client like Sourcetree or GitHub Desktop
- Create an SSH Key for your GitHub account and add it to your local machine.
- Install the Go Extension for VS Code
- In VS Code, open the Extensions menu and search for "Go". The developer should be "Go Team at Google".
- Install any suggested Go tools as prompted by Visual Studio
- Clone the ec-sdk-go repository.
- Set
golangci-lint
as your linter:- Navigate to VS Code's settings.
- Search for
go.lintTool
. - In the Go: Lint Tool dropdown, select
golangci-lint
.
- Set up VS Code to run
gofumpt
automatically when saving a.go
file:
Install
go install mvdan.cc/gofumpt@latest
Open VS Code's settings and search for gopls
.
Click the link to edit settings.json directly and add the following:
"go.useLanguageServer": true,
"gopls": {
"formatting.gofumpt": true,
},
Create a branch off of main and begin coding!
Ensure that all unit tests pass before submitting a pull request.
- Open a terminal at the root of the repository.
- Run
go test ./…
from the repository root.
Consider the scope of changes in your PR and whether it is necessary to run some or all of the example files located in the example folder as end-to-end tests to identify regressions.
Create a new release in GitHub with the appropriate vM.m.r semantic version e.g. v0.1.8 via the releases tab. Ensure to create a tag on the release screen using the same name. This process will be replaced with a GitHub action in the future.
In your release, be sure to include each section below. If there are no changes for a section, omit it. Refer to existing releases.
- Breaking Changes
- Alert consumers of the SDK of any changes that can break their code.
- New Features
- Bug Fixes and Enhancements
- Enhancements can include performance improvements, code optimization, etc.