Skip to content

Commit

Permalink
update dependencies (#30)
Browse files Browse the repository at this point in the history
* update dependencies

* fsnotify: v1.4.7
* gostats: v0.3.2
* logrus: v1.4.2

* gofmt simplify

run gofmt -w -s on the code

* Fix Travis CI, update Go, remove Docker and add tests to Makefile
  • Loading branch information
Charlie Vieth authored Jul 3, 2019
1 parent 212b154 commit fd5ff74
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 39 deletions.
12 changes: 7 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
sudo: required
language: go
go: 1.7.1
go:
- "1.11"
- "1.12"

services:
- docker
before_install: mkdir -p $GOPATH/bin
install: make install
script: make test

install: make bootstrap
script: make tests
# TODO: run 'make lint' once it passes
6 changes: 0 additions & 6 deletions Dockerfile

This file was deleted.

50 changes: 38 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,43 @@
.PHONY: bootstrap
bootstrap:
script/install-glide
# Go source files
SRCS := $(shell find . -type d -name 'vendor' -prune -o -name '*.go' -print)

.PHONY: install
install: glide #download dependencies (including test deps) for the package
glide install

.PHONY: update
update:
glide up
glide install
update: glide #updates dependencies used by the package and installs them
glide update

.PHONY: glide
glide: # ensure the glide package tool is installed
which glide || go get github.com/Masterminds/glide

.PHONY: lint
lint: #lints the package for common code smells
@for file in $(SRCS); do \
gofmt -d -s $${file}; \
if [ -n "$$(gofmt -d -s $${file})" ]; then \
exit 1; \
fi; \
done
which golint || go get -u golang.org/x/lint/golint
which shadow || go get golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow
golint -set_exit_status $(shell go list ./...)
go vet -all ./...
go vet -vettool=$(which shadow) ./...

.PHONY: test
test: # runs all tests against the package with race detection and coverage percentage
go test -race -cover ./...

.PHONY: quick
quick: # runs all tests without coverage or the race detector
go test ./...

.PHONY: tests
tests:
go test -cover -race $(shell glide nv)
.PHONY: cover
cover: # runs all tests against the package, generating a coverage report and opening it in the default browser
go test -race -covermode=atomic -coverprofile=cover.out ./...
go tool cover -html cover.out -o cover.html
which open && open cover.html

.PHONY: docker-tests
docker-tests:
docker run goruntime make tests
21 changes: 9 additions & 12 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions glide.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package: github.com/lyft/goruntime
import:
- package: github.com/sirupsen/logrus
version: ^1.0
version: ^v1.4.2
- package: github.com/lyft/gostats
version: ^0.2.2
version: ^v0.3.2
- package: github.com/fsnotify/fsnotify
version: v1.4.2
version: ^v1.4.7
testImport:
- package: github.com/stretchr/testify
version: ~1.1.4
Expand Down
2 changes: 1 addition & 1 deletion snapshot/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (s *Snapshot) GetModified(key string) time.Time {

func (s *Snapshot) Keys() []string {
ret := []string{}
for key, _ := range s.entries {
for key := range s.entries {
ret = append(ret, key)
}
return ret
Expand Down

0 comments on commit fd5ff74

Please sign in to comment.