Skip to content

Commit 7ebaee7

Browse files
authored
Merge pull request #9 from hfm/refactor
Refactor
2 parents 3a1a4ab + 2df8abb commit 7ebaee7

File tree

11 files changed

+199
-338
lines changed

11 files changed

+199
-338
lines changed

.travis.yml

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,8 @@
11
language: go
22
go:
3-
- 1.6
4-
- tip
5-
env: PATH=/home/travis/gopath/bin:$PATH
6-
install: go get github.com/mitchellh/gox
7-
script: make test
3+
- 1.11.x
4+
script:
5+
- make test
6+
- make lint
87
after_success:
9-
- echo "packaging by ${TRAVIS_GO_VERSION}"
10-
- make package
11-
deploy:
12-
provider: releases
13-
api_key:
14-
secure: JJtg1hfiaWM09ugh0ynFbXzXs39ZD+vG87XOH1CiULCtCclf/xK5Cyn4tS/H3ICGDsszZprq7zsn33z1+98+lwLXXjb5fzj1fxhcMphUlobdaSMnSTDmkbyHj3hh/SO8K6y+aBLXz2AB5uFqJwHlcOGaydmBGKHi+xTqMC0N7MNbi7J2RCmlMtRgWZ5zXM27VeCF/utXHcBuoAn9/zIj8+wSHMsvXPIb/oQJ/xSHPbH8R/ll8iMJqoWuLqyBiXf6ycUoVUZjhER8hKSqwfDcKFKxUjgReiisZ9NZ77ludKBiea6oFWTrj99yXMp8aajWZU4XnFjKHYdk42icZ1Q+wXhvrVAQJZ/dkW4aTY/0xuI12L8y0ssOjnQBwnKizWLychmYfiONlvjRcHV/g9K1qUyF+KDayoVZwFcMiicELVBIXPG5jCvxeZyomZLk7AcyEglo6DRpuG0Wa+2QtsofxB/5B8cFdjbzmA6+t8ymloIFd8f2qdAa5XMorVp7nvKkV2nA1bKGmD7tKYyQ4G/VbYMzFgIQhVN8VOxFFrEuKDAYlpHfBjZ1xpw0JUmyS0P0hA71niLFgCED97QwFUNs1rMw+W/iqzbymGA/4rA7Oy/x2RCh1vW1eaa5I7Y83NUW8V9d+5WuUSZlpQIylvz6AxUzGGlsjb+vhFjm562Oif8=
15-
file: pkg/dist/*/*
16-
file_glob: true
17-
skip_cleanup: true
18-
on:
19-
repo: hfm/mackerel-plugin-mogilefs
20-
condition: "$TRAVIS_GO_VERSION = 1.6"
21-
tags: true
22-
notifications:
23-
slack:
24-
secure: hnaMhM7ZDy2+rNPXRKfz9Z10ZxKvLFJuQaxU5xC3JnZ2B3ddx9iXwgATtIOy/5n6PLxIm9pselGFXPJ2kE9uTMOz2l0+at5rfFySFBiO1E+s9S2EmQMe7j447tZdt93A9WnKOjBdvkP5g2G4B68sFDDh+w4lh5TzsJX1h3XGcNLXq/UfHJ4hViQMhOGRIBgyaduJg651Wq8zvjfgDK4MWNhkt848X1qmxUjAeZZxEjfCaScoWv2R0YkYCwJgFIJTEGnst6gKh6dO9GdjYq1PdpO2TVbJMatRS6jW33YBIbHD//h6Yt2dchPX9QPwfqJMvWXOEamUUtdTYgil13wBWPh7x3rOBcXRdbvxJhp3M3+EPffXNWjY+hJM5m5A6epWN0OFz81JKr5RdiT2cqnDGY8a8bSPIcBCURvpZDgJTapbJkeF7DusSENpCl/68uz0loqCj8MePpHwJYb7MTvMKFOPyUtZrsoeHdQp6UwRC9ZS013nh/JLgCqwLHl5FRBWQmt4RqUBsRWcgvP8bgU4F7L7shHpOkHaVYU8wODNMHqnBhpCQHVbaQOWv4sADpOQtYjkNH95KMRCdnInoyuj4JmPHgcY4EdXwFmeLbvwmsNfNqIotN/J5FfXu5Owxq8RLLh/tMywkqsr/Hli4JqdGhJwydFkM2VY52Fid7w0OS8=
8+
- if [[ $TRAVIS_TAG =~ ^v[0-9].*$ ]]; then script/release; fi

Makefile

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,15 @@
1-
COMMIT = $$(git describe --tags --always)
2-
BUILD_FLAGS = -ldflags "-X main.GitCommit=\"$(COMMIT)\""
3-
4-
clean:
5-
rm -f mackerel-plugin-mogilefs
6-
rm -fr pkg/
7-
8-
deps:
1+
setup:
2+
go get \
3+
github.com/Songmu/goxz/cmd/goxz \
4+
github.com/tcnksm/ghr \
5+
github.com/golang/lint/golint
96
go get -d -t ./...
10-
go get golang.org/x/tools/cmd/cover
11-
go get golang.org/x/tools/cmd/vet
127

13-
test: deps
8+
test: setup
149
go test -v ./...
15-
go test -race ./...
16-
go vet .
17-
18-
cover: deps
19-
go test $(TEST) -coverprofile=coverage.out
20-
go tool cover -html=coverage.out
21-
rm coverage.out
22-
23-
build: deps
24-
go build $(BUILD_FLAGS)
2510

26-
install: deps
27-
go install $(BUILD_FLAGS)
11+
lint: setup
12+
go vet ./...
13+
golint -set_exit_status ./...
2814

29-
package: deps
30-
@sh -c "'$(CURDIR)/scripts/package.sh'"
15+
.PHONY: setup test lint

cli.go

Lines changed: 0 additions & 158 deletions
This file was deleted.

cli_test.go

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)