From f9070d3b400d7bf7c9b4e4e05916f92fd0b79e0c Mon Sep 17 00:00:00 2001 From: Thomas Pelletier Date: Thu, 21 Mar 2019 17:22:05 -0700 Subject: [PATCH] Use go mod (#265) --- .circleci/config.yml | 5 ++--- .travis.yml | 5 ++--- appveyor.yml | 4 +--- go.mod | 9 +++++++++ go.sum | 7 +++++++ 5 files changed, 21 insertions(+), 9 deletions(-) create mode 100644 go.mod create mode 100644 go.sum diff --git a/.circleci/config.yml b/.circleci/config.yml index 5946d65..a0ef2d7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,9 +13,6 @@ commands: description: "Get go dependencies" steps: - run: go get github.com/jstemmer/go-junit-report - - run: go get github.com/davecgh/go-spew/spew - - run: go get gopkg.in/yaml.v2 - - run: go get github.com/BurntSushi/toml run_test: description: "Run unit tests for a go module" @@ -53,6 +50,8 @@ jobs: name: golang version: "<>" working_directory: /go/src/github.com/pelletier/go-toml + environment: + GO111MODULE: "on" steps: - checkout - run: mkdir -p /tmp/workspace diff --git a/.travis.yml b/.travis.yml index 326e09c..abb03e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,11 +8,10 @@ matrix: allow_failures: - go: tip fast_finish: true +env: + - GO111MODULE=on script: - if [ -n "$(go fmt ./...)" ]; then exit 1; fi - - go get github.com/davecgh/go-spew/spew - - go get gopkg.in/yaml.v2 - - go get github.com/BurntSushi/toml - go test github.com/pelletier/go-toml -race -coverprofile=coverage.txt -covermode=atomic - go test github.com/pelletier/go-toml/cmd/tomljson - go test github.com/pelletier/go-toml/cmd/tomll diff --git a/appveyor.yml b/appveyor.yml index 5707803..40e8a41 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -8,6 +8,7 @@ environment: GOPATH: c:\gopath DEPTESTBYPASS501: 1 GOVERSION: 1.12 + GO111MODULE: on init: - git config --global core.autocrlf input @@ -27,9 +28,6 @@ build: false deploy: false test_script: - - go get github.com/davecgh/go-spew/spew - - go get gopkg.in/yaml.v2 - - go get github.com/BurntSushi/toml - go test github.com/pelletier/go-toml - go test github.com/pelletier/go-toml/cmd/tomljson - go test github.com/pelletier/go-toml/cmd/tomll diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..f4690e1 --- /dev/null +++ b/go.mod @@ -0,0 +1,9 @@ +module github.com/pelletier/go-toml + +go 1.12 + +require ( + github.com/BurntSushi/toml v0.3.1 + github.com/davecgh/go-spew v1.1.1 + gopkg.in/yaml.v2 v2.2.2 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..8d91a47 --- /dev/null +++ b/go.sum @@ -0,0 +1,7 @@ +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=