Skip to content

Commit

Permalink
Improve CI (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulBernier committed Dec 19, 2020
1 parent ca3331d commit 85d52cc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
24 changes: 22 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ version: 2
jobs:
build:
docker:
# CircleCI Go images available at: https://hub.docker.com/r/circleci/golang/
- image: circleci/golang:1.14

environment:
Expand All @@ -16,7 +15,6 @@ jobs:
keys:
- go-mod-v4-{{ checksum "go.sum" }}

# Make sure it builds first
- run: go build

- run:
Expand All @@ -37,8 +35,30 @@ jobs:
- store_test_results:
path: /tmp/test-results

gofmt:
docker:
- image: circleci/golang:1.14

steps:
- checkout
- run:
name: "Enforce Go Formatted Code"
command: test $(gofmt -l . | wc -l) -eq 0

govet:
docker:
- image: circleci/golang:1.14

steps:
- checkout
- run:
name: "Go vet"
command: go vet ./...

workflows:
version: 2
build-workflow:
jobs:
- build
- gofmt
- govet
4 changes: 2 additions & 2 deletions entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func (e *Entry) UnmarshalJSON(data []byte) error {
}

func EntryCommitMessage(e *Entry, ec *ECAddress) (*bytes.Buffer, error) {
buf := new(bytes.Buffer)
buf := new(bytes.Buffer)

// 1 byte version
buf.Write([]byte{0})
Expand Down Expand Up @@ -209,7 +209,7 @@ func EntryCommitMessage(e *Entry, ec *ECAddress) (*bytes.Buffer, error) {
// Entry Credit Signature.
func ComposeEntryCommit(e *Entry, ec *ECAddress) (*JSON2Request, error) {
b, err := EntryCommitMessage(e, ec)
if err != nil {
if err != nil {
return nil, err
}
params := messageRequest{Message: hex.EncodeToString(b.Bytes())}
Expand Down

0 comments on commit 85d52cc

Please sign in to comment.