Skip to content

Commit

Permalink
Merge pull request #2 from circleci/README-instructions
Browse files Browse the repository at this point in the history
Fixup README and rename binary
  • Loading branch information
Zachary Scott authored Jun 4, 2018
2 parents 5788fd6 + 59770f1 commit d8a755f
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 27 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ SHA=$(shell git rev-parse --short HEAD)

GOFILES = $(shell find . -name '*.go' -not -path './vendor/*')

CLIPATH=github.com/circleci/cli
CLIPATH=github.com/circleci/circleci-cli

EXECUTABLE=cli
EXECUTABLE=circleci-cli
BUILD_DIR=build

.PHONY: build/linux
Expand Down
68 changes: 44 additions & 24 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
```

On Linux, etc:

```
$ curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
```
This includes setting a valid `$GOPATH`.

Ensure dependencies are installed:
### 1. Get the repo

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

### 2. Build it
Expand All @@ -48,7 +35,7 @@ $ make
### 3. Run Diagnostic check

```
$ ./build/target/linux/amd64/cli diagnostic
$ ./build/target/linux/amd64/circleci-cli diagnostic
Please enter your CircleCI API token:
OK.
Expand All @@ -64,23 +51,56 @@ 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

* ...

## Doc

You can view godoc of cli in your browser.
You can view `godoc` of cli in your browser.

1. Run `godoc -http=:6060`
2. Access http://localhost:6060/pkg/github.com/circleci/cli/
2. Access http://localhost:6060/pkg/github.com/circleci/circleci-cli/

## 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 can set 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)
```
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"github.com/circleci/cli/cmd"
"github.com/circleci/circleci-cli/cmd"
)

func main() {
Expand Down

0 comments on commit d8a755f

Please sign in to comment.