Skip to content

Commit

Permalink
Better instructions for setting up project
Browse files Browse the repository at this point in the history
  • Loading branch information
Zachary Scott committed Jun 4, 2018
1 parent 5788fd6 commit 7a414ff
Showing 1 changed file with 43 additions and 21 deletions.
64 changes: 43 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,17 @@ It's written in Go. If you are new to Go, we recommend the following resources:
* [A Tour of Go](https://tour.golang.org/welcome/1)
* [The Go documentation](https://golang.org/doc/)

## Development Workflow
## Development

### 1. Go Dependencies
You should already have [installed Go](https://golang.org/doc/install) and setup your [workspace](https://golang.org/doc/code.html#Workspaces).

Install `dep`:
https://github.com/golang/dep

On MacOS:

```
$ brew install dep
$ brew upgrade dep
```
This includes setting a valid `$GOPATH`.

On Linux, etc:
### 1. Get the repo

```
$ curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
```

Ensure dependencies are installed:

```
$ dep ensure
$ go get -u github.com/circleci/circleci-cli
$ cd $GOPATH/src/github.com/circleci/circleci-cli
```

### 2. Build it
Expand Down Expand Up @@ -64,6 +51,30 @@ Host is: https://circleci.com
OK, got a token.
```

## Dependencies

We use `dep` for vendoring our depencencies:
https://github.com/golang/dep

You can install it on MacOS:

```
$ brew install dep
$ brew upgrade dep
```

Or on Linux, etc:

```
$ curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
```

To make sure dependencies are installed:

```
$ dep ensure
```

## Known Issues

* ...
Expand All @@ -77,10 +88,21 @@ You can view godoc of cli in your browser.

## Editor support

Go has great tooling for editors.
Go has great tooling such as [`gofmt`][https://golang.org/cmd/gofmt/] and [`goimports`](https://godoc.org/golang.org/x/tools/cmd/goimports).

```
$ go get golang.org/x/tools/cmd/goimports
```

More [here](https://blog.golang.org/go-fmt-your-code).
You can read about `gofmt` [here](https://blog.golang.org/go-fmt-your-code).

In particular, you should it up with [vim](https://github.com/fatih/vim-go) or [emacs](https://github.com/dominikh/go-mode.el).

I've the following in my `.emacs.d/init.el`:

```
(setq gofmt-command "goimports")
(require 'go-mode)
(add-hook 'before-save-hook 'gofmt-before-save)
(require 'go-rename)
```

0 comments on commit 7a414ff

Please sign in to comment.