GitHub is used for project Source Code Management (SCM) using the SSH protocol for authentication.
- Create a GitHub account if you do not already have one.
- Setup GitHub access via SSH
You must install these tools:
-
git
: For source control -
go
: The language this SDK is built in.Note Golang version v1.18 or higher is required.
-
make
: not stricly required but handy to run tests with a single command.
The sdk-go project requires that you develop (commit) code changes to branches that belong to a fork of the cdevents/sdk-go
repository in your GitHub account before submitting them as Pull Requests (PRs) to the actual project repository.
-
Create a fork of the
cdevents/sdk-go
repository in your GitHub account. -
Create a clone of your fork on your local machine:
git clone [email protected]:${YOUR_GITHUB_USERNAME}/sdk-go.git
-
Configure
git
remote repositoriesAdding
cdevents/sdk-go
as theupstream
and your fork as theorigin
remote repositories to your.git/config
sets you up nicely for regularly syncing your fork and submitting pull requests.-
Change into the project directory
cd sdk-go
-
Configure sdk-go as the
upstream
repositorygit remote add upstream [email protected]:cdevents/sdk-go.git # Optional: Prevent accidental pushing of commits by changing the upstream URL to `no_push` git remote set-url --push upstream no_push
-
Configure your fork as the
origin
repositorygit remote add origin [email protected]:${YOUR_GITHUB_USERNAME}/sdk-go.git
-
Make target all defined to run unit tests, format imports, format go code and run the linter.
To format the go code and imports:
$ make fmt
To run the go linter:
$ make lint
To run unit tests:
$ make test
To run all targets, before creating a commit:
make all