Skip to content

Development

Tim Pavlik edited this page Jun 22, 2020 · 4 revisions

Quick Start

Requirements

  • Homebrew

Setup

brew install golang # and set up your environment
brew install jq

Run Unit Tests

make test_unit

Contribution Guide

Project Setup

  1. Clone this repo into any location, since we're using modules it is recommended this actually be outside of your $GOPATH e.g. git clone https://github.com/splunk/splunk-cloud-sdk-go.git ~/src/splunk-cloud-sdk-go
  2. Enter the cloned repo with cd ~/src/splunk-cloud-sdk-go replacing the path for whatever you cloned to in step 1
  3. Setup required development using make setup
  4. Now you should be able to build with make build
  5. The newly-built scloud binary with any changes you have made should now available in bin/scloud

Lint

  • Make sure your code is passing linting using make lint

Vet

  • Make sure your code is passing go vet using make vet

Format

Automatically format your code with gofmt and goimports using make format and commit any formatting changes

Add new project dependencies

We have added the mod=readonly flag to our go build commands to prevent automatic updating of go.mod to track new dependencies in order to prevent accidental updates/changes in CI. If you need to add a dependency so that this project and its imports will build correctly please use go get which will update go.mod and go.sum. You should then push the changes made to go.mod and go.sum.

Clone this wiki locally