switched to go modules

This commit is contained in:
Daniel Czerwonk 2019-01-14 19:16:36 +01:00
parent 0ff505a8a7
commit 134bf29f00
6 changed files with 49 additions and 205 deletions

View File

@ -1,4 +1,4 @@
language: go
go:
- "1.11"
script: make init test lint
script: go test ./...

99
Gopkg.lock generated
View File

@ -1,99 +0,0 @@
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
branch = "master"
name = "github.com/alecthomas/template"
packages = [".","parse"]
revision = "a0175ee3bccc567396460bf5acd36800cb10c49c"
[[projects]]
branch = "master"
name = "github.com/alecthomas/units"
packages = ["."]
revision = "2efee857e7cfd4f3d0138cc3cbb1b4966962b93a"
[[projects]]
branch = "master"
name = "github.com/beorn7/perks"
packages = ["quantile"]
revision = "4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9"
[[projects]]
branch = "master"
name = "github.com/czerwonk/bird_socket"
packages = ["."]
revision = "fe8194eb5598e088bb0a64174c1a1da6eeeb4fef"
[[projects]]
branch = "master"
name = "github.com/czerwonk/testutils"
packages = ["assert"]
revision = "dd9dabe360d49188fd1194907dcf0738cbca1858"
[[projects]]
branch = "master"
name = "github.com/golang/protobuf"
packages = ["proto"]
revision = "130e6b02ab059e7b717a096f397c5b60111cae74"
[[projects]]
name = "github.com/matttproud/golang_protobuf_extensions"
packages = ["pbutil"]
revision = "3247c84500bff8d9fb6d579d800f20b3e091582c"
version = "v1.0.0"
[[projects]]
name = "github.com/prometheus/client_golang"
packages = ["prometheus","prometheus/promhttp"]
revision = "c5b7fccd204277076155f10851dad72b76a49317"
version = "v0.8.0"
[[projects]]
branch = "master"
name = "github.com/prometheus/client_model"
packages = ["go"]
revision = "6f3806018612930941127f2a7c6c453ba2c527d2"
[[projects]]
branch = "master"
name = "github.com/prometheus/common"
packages = ["expfmt","internal/bitbucket.org/ww/goautoneg","log","model"]
revision = "2f17f4a9d485bf34b4bfaccc273805040e4f86c8"
[[projects]]
branch = "master"
name = "github.com/prometheus/procfs"
packages = [".","xfs"]
revision = "e645f4e5aaa8506fc71d6edbc5c4ff02c04c46f2"
[[projects]]
name = "github.com/sirupsen/logrus"
packages = ["."]
revision = "f006c2ac4710855cf0f916dd6b77acf6b048dc6e"
version = "v1.0.3"
[[projects]]
branch = "master"
name = "golang.org/x/crypto"
packages = ["ssh/terminal"]
revision = "76eec36fa14229c4b25bb894c2d0e591527af429"
[[projects]]
branch = "master"
name = "golang.org/x/sys"
packages = ["unix","windows","windows/registry","windows/svc/eventlog"]
revision = "314a259e304ff91bd6985da2a7149bbf91237993"
[[projects]]
name = "gopkg.in/alecthomas/kingpin.v2"
packages = ["."]
revision = "1087e65c9441605df944fb12c33f0fe7072d18ca"
version = "v2.2.5"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "7a2645f79517b39461869d1e2f5071eb7509e85d3ee6ad23d19892d6387542e7"
solver-name = "gps-cdcl"
solver-version = 1

View File

@ -1,38 +0,0 @@
# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
[[constraint]]
branch = "master"
name = "github.com/czerwonk/bird_socket"
[[constraint]]
branch = "master"
name = "github.com/czerwonk/testutils"
[[constraint]]
name = "github.com/prometheus/client_golang"
version = "0.8.0"
[[constraint]]
branch = "master"
name = "github.com/prometheus/common"

View File

@ -1,67 +0,0 @@
APP = bird_exporter
VERSION=$(shell \
grep "version string =" main.go \
|awk -F'=' '{print $$2}' \
|sed -e "s/[^0-9.]//g" \
|sed -e "s/ //g")
SHELL = /bin/bash
GO = go
DIR = $(shell pwd)
NO_COLOR=\033[0m
OK_COLOR=\033[32;01m
ERROR_COLOR=\033[31;01m
WARN_COLOR=\033[33;01m
MAKE_COLOR=\033[33;01m%-20s\033[0m
MAIN = github.com/czerwonk/bird_exporter
SRCS = $(shell git ls-files '*.go' | grep -v '^vendor/')
PKGS = $(shell go list ./... | grep -v '/vendor/')
.DEFAULT_GOAL := help
.PHONY: help
help:
@echo -e "$(OK_COLOR)==== $(APP) [$(VERSION)] ====$(NO_COLOR)"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "$(MAKE_COLOR) : %s\n", $$1, $$2}'
.PHONY: init
init: ## Install requirements
@echo -e "$(OK_COLOR)[$(APP)] Install requirements$(NO_COLOR)"
@go get -u github.com/golang/dep/cmd/dep
@go get -u github.com/golang/lint/golint
.PHONY: deps
deps: ## Update dependencies
@echo -e "$(OK_COLOR)[$(APP)] Update dependencies$(NO_COLOR)"
@dep ensure
.PHONY: build
build: ## Make binary
@echo -e "$(OK_COLOR)[$(APP)] Build $(NO_COLOR)"
@go build .
.PHONY: test
test: ## Launch unit tests
@echo -e "$(OK_COLOR)[$(APP)] Launch unit tests $(NO_COLOR)"
@$(foreach pkg,$(PKGS),go test $(pkg) || exit;)
.PHONY: lint
lint: ## Launch golint
@$(foreach file,$(SRCS),golint $(file) || exit;)
.PHONY: vet
vet: ## Launch go vet
@$(foreach file,$(SRCS),$(GO) vet $(file) || exit;)
.PHONY: coverage
coverage: ## Launch code coverage
@$(foreach pkg,$(PKGS),$(GO) test -cover $(pkg) || exit;)
# for goprojectile
.PHONY: gopath
gopath:
@echo `pwd`:`pwd`/vendor

19
go.mod Normal file
View File

@ -0,0 +1,19 @@
module github.com/czerwonk/bird_exporter
require (
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf
github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a
github.com/czerwonk/bird_socket v0.0.0-20170701072538-fe8194eb5598
github.com/czerwonk/testutils v0.0.0-20170526233935-dd9dabe360d4
github.com/golang/protobuf v0.0.0-20170920220647-130e6b02ab05
github.com/matttproud/golang_protobuf_extensions v1.0.0
github.com/prometheus/client_golang v0.8.0
github.com/prometheus/client_model v0.0.0-20170216185247-6f3806018612
github.com/prometheus/common v0.0.0-20170908161822-2f17f4a9d485
github.com/prometheus/procfs v0.0.0-20170703101242-e645f4e5aaa8
github.com/sirupsen/logrus v1.0.3
golang.org/x/crypto v0.0.0-20170928142450-76eec36fa142
golang.org/x/sys v0.0.0-20170927054621-314a259e304f
gopkg.in/alecthomas/kingpin.v2 v2.2.5
)

29
go.sum Normal file
View File

@ -0,0 +1,29 @@
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5VpdgMhJosfJnn5/FoN2SRZ4p7fJNX58YPaU=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZqLG4oE62mJzwPIB8+Tee4RNCL9ulrY=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a h1:BtpsbiV638WQZwhA98cEZw2BsbnQJrbd0BI7tsy0W1c=
github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/czerwonk/bird_socket v0.0.0-20170701072538-fe8194eb5598 h1:PoKf7YEmuDOGzXD52jaJhZeOuwRrgv9FbZF8yfyoF7A=
github.com/czerwonk/bird_socket v0.0.0-20170701072538-fe8194eb5598/go.mod h1:SQ2xpIC3W7ygMomUYEsxXBeun7RML/HCNXj24fbz+XI=
github.com/czerwonk/testutils v0.0.0-20170526233935-dd9dabe360d4/go.mod h1:Xibh2UDW2TbNjbi8QON4p0QxiYK/RM5USagAW7J3jUM=
github.com/golang/protobuf v0.0.0-20170920220647-130e6b02ab05 h1:Kesru7U6Mhpf/x7rthxAKnr586VFmoE2NdEvkOKvfjg=
github.com/golang/protobuf v0.0.0-20170920220647-130e6b02ab05/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/matttproud/golang_protobuf_extensions v1.0.0 h1:YNOwxxSJzSUARoD9KRZLzM9Y858MNGCOACTvCW9TSAc=
github.com/matttproud/golang_protobuf_extensions v1.0.0/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/prometheus/client_golang v0.8.0 h1:1921Yw9Gc3iSc4VQh3PIoOqgPCZS7G/4xQNVUp8Mda8=
github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_model v0.0.0-20170216185247-6f3806018612 h1:13pIdM2tpaDi4OVe24fgoIS7ZTqMt0QI+bwQsX5hq+g=
github.com/prometheus/client_model v0.0.0-20170216185247-6f3806018612/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/common v0.0.0-20170908161822-2f17f4a9d485 h1:ELypU1kBAPEzqcj8hphDyZWTJw5TIFgepXU983BEkD0=
github.com/prometheus/common v0.0.0-20170908161822-2f17f4a9d485/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/procfs v0.0.0-20170703101242-e645f4e5aaa8 h1:uZfczEBIA1FZfOQo4/JWgGnMNd/4HVsM9A+B30wtlkA=
github.com/prometheus/procfs v0.0.0-20170703101242-e645f4e5aaa8/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/sirupsen/logrus v1.0.3 h1:B5C/igNWoiULof20pKfY4VntcIPqKuwEmoLZrabbUrc=
github.com/sirupsen/logrus v1.0.3/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc=
golang.org/x/crypto v0.0.0-20170928142450-76eec36fa142 h1:5T6aMun9V7kQkjsSk9ZbDDnTnZNNwh4HDNahEeONaD8=
golang.org/x/crypto v0.0.0-20170928142450-76eec36fa142/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/sys v0.0.0-20170927054621-314a259e304f h1:iUy6hSM2lPBGm2d9HgXq1GqYPwcJvA8ihnWauXggYMs=
golang.org/x/sys v0.0.0-20170927054621-314a259e304f/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
gopkg.in/alecthomas/kingpin.v2 v2.2.5 h1:qskSCq465uEvC3oGocwvZNsO3RF3SpLVLumOAhL0bXo=
gopkg.in/alecthomas/kingpin.v2 v2.2.5/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=