diff --git a/.circleci/config.yml b/.circleci/config.yml index 5d5809f..a2d63e5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,44 +1,16 @@ version: 2 jobs: - build-go-latest: + build-go1.11: docker: - - image: golang:1.10 - working_directory: /go/src/github.com/kolide/osquery-go + - image: golang:1.11 + working_directory: /go/src/github.com/kolide/kit steps: &steps - checkout - - - restore_cache: - keys: - - vendor-cache-{{ .Branch }}-{{ checksum "Gopkg.lock" }} - - vendor-cache-{{ .Branch }} - - vendor-cache - run: make deps - - save_cache: - key: vendor-cache-{{ .Branch }}-{{ checksum "Gopkg.lock" }} - paths: - - vendor - - save_cache: - key: vendor-cache-{{ .Branch }} - paths: - - vendor - - save_cache: - key: vendor-cache - paths: - - vendor - - - run: go test -race -cover -v $(go list ./... | grep -v /vendor/) - - run: make examples - - build-go1.9: - docker: - - image: golang:1.9 - working_directory: /go/src/github.com/kolide/osquery-go - steps: *steps + - run: make test workflows: version: 2 build: jobs: - - build-go-latest - - build-go1.9 - + - build-go1.11 diff --git a/Makefile b/Makefile index dc54692..a3c4197 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,17 @@ PATH := $(GOPATH)/bin:$(PATH) +export GO111MODULE=on all: gen examples -deps: - go get -u github.com/golang/dep/cmd/dep - dep ensure -vendor-only +go-mod-check: + @go help mod > /dev/null || (echo "Your go is too old, no modules. Seek help." && exit 1) + +go-mod-download: + go mod download + +deps-go: go-mod-check go-mod-download + +deps: deps-go gen: ./osquery.thrift mkdir ./gen @@ -33,7 +40,7 @@ example_config: examples/config/*.go go build -o example_config ./examples/config/*.go test: all - go test -race -cover -v $(shell go list ./... | grep -v /vendor/) + go test -race -cover ./... clean: rm -rf ./build ./gen diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..258343b --- /dev/null +++ b/go.mod @@ -0,0 +1,11 @@ +module github.com/kolide/osquery-go + +require ( + git.apache.org/thrift.git v0.0.0-20180705132951-f12cacf56145 + github.com/Microsoft/go-winio v0.4.9 + github.com/davecgh/go-spew v1.1.0 // indirect + github.com/pkg/errors v0.8.0 + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/stretchr/testify v1.2.2 + golang.org/x/sys v0.0.0-20180815093151-14742f9018cd // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..7643a21 --- /dev/null +++ b/go.sum @@ -0,0 +1,14 @@ +git.apache.org/thrift.git v0.0.0-20180705132951-f12cacf56145 h1:cKvJzsWvFw5ZW8q+sLkIqmLnl9+MNuUbYQGoT0a/KFg= +git.apache.org/thrift.git v0.0.0-20180705132951-f12cacf56145/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= +github.com/Microsoft/go-winio v0.4.9 h1:3RbgqgGVqmcpbOiwrjbVtDHLlJBGF6aE+yHmNtBNsFQ= +github.com/Microsoft/go-winio v0.4.9/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +golang.org/x/sys v0.0.0-20180815093151-14742f9018cd h1:Vdp9FdQnZJQQF78wgpudgkchp80Nu37AWr8+mprtgAo= +golang.org/x/sys v0.0.0-20180815093151-14742f9018cd/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=