From 83b7d0ee7d48c467831febde16a958407ae6c26b Mon Sep 17 00:00:00 2001 From: Adam Shannon Date: Thu, 29 Sep 2022 08:45:52 -0500 Subject: [PATCH 1/4] build: switch to Github Actions and Go 1.19.x --- .github/workflows/go.yml | 37 +++++++++++++++++++++++++++++++++++++ .travis.yml | 26 -------------------------- go.mod | 17 ++++++++++++----- go.sum | 4 ---- 4 files changed, 49 insertions(+), 35 deletions(-) create mode 100644 .github/workflows/go.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..627a86f --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,37 @@ +name: Go + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + name: Go Build + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + steps: + - name: Set up Go 1.x + uses: actions/setup-go@v2 + with: + go-version: '>= 1.19.1' + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Setup + run: | + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.49.0 + + - name: Test + run: | + golangci-lint run # run a bunch of code checkers/linters in parallel + go test -v -race ./... # Run all the tests with the race detector enabled + + - name: Upload Code Coverage + if: runner.os == 'Linux' + run: bash <(curl -s https://codecov.io/bash) diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 69eef7c..0000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: go -go: - - 1.13.x - - 1.14.x - -# Only clone the most recent commit. -git: - depth: 1 - -# Don't email me the results of the test runs. -notifications: - email: false - -# Anything in before_script that returns a nonzero exit code will flunk the -# build and immediately stop. It's sorta like having set -e enabled in bash. -# Make sure golangci-lint is vendored. -before_script: - - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.27.0 - -# script always runs to completion (set +e). If we have linter issues AND a -# failing test, we want to see both. Configure golangci-lint with a -# .golangci.yml file at the top level of your repo. -script: - - golangci-lint run # run a bunch of code checkers/linters in parallel - - go test -v -race ./... # Run all the tests with the race detector enabled - diff --git a/go.mod b/go.mod index 93accd9..d542146 100644 --- a/go.mod +++ b/go.mod @@ -1,18 +1,25 @@ module github.com/ovh/symmecrypt -go 1.13 +go 1.19 require ( github.com/SSSaaS/sssa-golang v0.0.0-20170502204618-d37d7782d752 - github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect - github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect github.com/miscreant/miscreant.go v0.0.0-20200214223636-26d376326b75 github.com/ovh/configstore v0.3.3-0.20200701085609-a539fcf61db5 github.com/pelletier/go-toml v1.8.0 github.com/stretchr/testify v1.6.1 golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 - golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c // indirect gopkg.in/alecthomas/kingpin.v2 v2.2.6 - gopkg.in/check.v1 v1.0.0-20160105164936-4f90aeace3a2 // indirect gopkg.in/yaml.v2 v2.3.0 ) + +require ( + github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect + github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/ghodss/yaml v1.0.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c // indirect + gopkg.in/check.v1 v1.0.0-20160105164936-4f90aeace3a2 // indirect + gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect +) diff --git a/go.sum b/go.sum index f45b739..0541732 100644 --- a/go.sum +++ b/go.sum @@ -20,24 +20,20 @@ github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bA 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/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 h1:DZhuSZLsGlFL4CmhA8BcRA0mnthyA/nZ00AqCUo7vHg= golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c h1:UIcGWL6/wpCfyGuJnRFJRurA+yj8RrW7Q6x2YMCXt6c= golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20160105164936-4f90aeace3a2 h1:+j1SppRob9bAgoYmsdW9NNBdKZfgYuWpqnYHv78Qt8w= gopkg.in/check.v1 v1.0.0-20160105164936-4f90aeace3a2/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 77739a681900f4d03c29843a30e0b559849d91b8 Mon Sep 17 00:00:00 2001 From: Adam Shannon Date: Thu, 29 Sep 2022 08:46:17 -0500 Subject: [PATCH 2/4] fix: code updates for go1.19 --- ciphers/hmac/hmac_test.go | 2 +- cmd/symmecrypt/main.go | 4 ++-- convergent/convergent.go | 2 +- convergent/convergent_test.go | 10 +++++----- keyloader/keyloader.go | 10 +++++----- stream/stream_test.go | 2 +- symutils/symutils.go | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/ciphers/hmac/hmac_test.go b/ciphers/hmac/hmac_test.go index 27b5db6..902320a 100644 --- a/ciphers/hmac/hmac_test.go +++ b/ciphers/hmac/hmac_test.go @@ -8,7 +8,7 @@ import ( ) func TestEncrypt(t *testing.T) { - + text := []byte("foobar") k, err := symmecrypt.NewRandomKey(CipherName) diff --git a/cmd/symmecrypt/main.go b/cmd/symmecrypt/main.go index ebfab38..b2f98a3 100644 --- a/cmd/symmecrypt/main.go +++ b/cmd/symmecrypt/main.go @@ -4,7 +4,7 @@ import ( "encoding/base64" "encoding/json" "fmt" - "io/ioutil" + "io" "log" "os" "strings" @@ -172,7 +172,7 @@ func main() { } func readSecret() string { - b, err := ioutil.ReadAll(os.Stdin) + b, err := io.ReadAll(os.Stdin) if len(b) == 0 { os.Exit(0) } diff --git a/convergent/convergent.go b/convergent/convergent.go index 73b0f67..c0fefb5 100644 --- a/convergent/convergent.go +++ b/convergent/convergent.go @@ -7,7 +7,7 @@ package convergent import ( - "crypto/sha1" + "crypto/sha1" //nolint:gosec "crypto/sha512" "encoding/hex" "errors" diff --git a/convergent/convergent_test.go b/convergent/convergent_test.go index f8ec0c8..b46aaac 100644 --- a/convergent/convergent_test.go +++ b/convergent/convergent_test.go @@ -29,7 +29,7 @@ import ( func TestKeyFromHash(t *testing.T) { // Create a new content that we want to encrypt clearContent := make([]byte, 10*1024*1024) - rand.Read(clearContent) // nolint + rand.Read(clearContent) // Get the hash to know if the content is already known and encrypted h, err := convergent.NewHash(bytes.NewReader(clearContent)) @@ -78,7 +78,7 @@ func runTest(t *testing.T, cipherName string) { // Create a new content that we want to encrypt clearContent := make([]byte, 10*1024*1024) - rand.Read(clearContent) // nolint + rand.Read(clearContent) // Get the hash to know if the content is already known and encrypted h, err := convergent.NewHash(bytes.NewReader(clearContent)) @@ -87,7 +87,7 @@ func runTest(t *testing.T, cipherName string) { t.Logf("hash=%s", h) _, has := mapHash[h] - require.False(t, has) // At this point the content is unkonwn + require.False(t, has) // At this point the content is unknown k, err := convergent.NewKey(h, cfgs...) require.NoError(t, err) @@ -275,7 +275,7 @@ func TestDecryptFromHTTP(t *testing.T) { // Encrypt a random content clearContent := make([]byte, 10*1024) - rand.Read(clearContent) // nolint + rand.Read(clearContent) h, err := convergent.NewHash(bytes.NewReader(clearContent)) require.NoError(t, err) @@ -292,7 +292,7 @@ func TestDecryptFromHTTP(t *testing.T) { // Serve the encrypted content ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { time.Sleep(1 * time.Second) - io.WriteString(w, encryptedContent) //nolint + io.WriteString(w, encryptedContent) })) defer ts.Close() diff --git a/keyloader/keyloader.go b/keyloader/keyloader.go index 2ecc3e2..541fb98 100644 --- a/keyloader/keyloader.go +++ b/keyloader/keyloader.go @@ -47,11 +47,11 @@ var ( ) // KeyConfig is the representation of an encryption key in the configuration. -// - Identifier is a free name to uniquely reference this key (and its revisions). It is used when loading the key. -// - Cipher controls which cipher is used (aes-gcm, ...) -// - Timestamp dictates priority between encryption keys, and is useful to identify new versions of a key -// - Sealed controls whether the key should be used as-is, or decrypted using symmecrypt/seal -// See RegisterCipher() to register a factory. The cipher field should be the same as the factory name. +// - Identifier is a free name to uniquely reference this key (and its revisions). It is used when loading the key. +// - Cipher controls which cipher is used (aes-gcm, ...) +// - Timestamp dictates priority between encryption keys, and is useful to identify new versions of a key +// - Sealed controls whether the key should be used as-is, or decrypted using symmecrypt/seal +// See RegisterCipher() to register a factory. The cipher field should be the same as the factory name. type KeyConfig struct { Identifier string `json:"identifier,omitempty"` Cipher string `json:"cipher"` diff --git a/stream/stream_test.go b/stream/stream_test.go index c2247d8..bbe6b9f 100644 --- a/stream/stream_test.go +++ b/stream/stream_test.go @@ -45,7 +45,7 @@ func TestMain(m *testing.M) { func TestIncompleteRead(t *testing.T) { clearContent := make([]byte, 32*1024+10) - rand.Read(clearContent) // nolint + rand.Read(clearContent) k, err := keyloader.LoadKey("test") require.NoError(t, err) diff --git a/symutils/symutils.go b/symutils/symutils.go index 5c9c912..05eb1b3 100644 --- a/symutils/symutils.go +++ b/symutils/symutils.go @@ -329,6 +329,6 @@ func (k *KeyMutex) String() (string, error) { func RandomSalt() string { var buff = make([]byte, 8) - rand.Read(buff) // nolint + rand.Read(buff) return string(buff) } From bb1c007f555a1d003437b837eb715fe1d4a12592 Mon Sep 17 00:00:00 2001 From: Adam Shannon Date: Thu, 29 Sep 2022 09:19:17 -0500 Subject: [PATCH 3/4] build: update deps - ovh/configstore, /x/crypto, and yaml.v2 --- go.mod | 11 ++++++----- go.sum | 29 +++++++++++++++-------------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index d542146..2e486f8 100644 --- a/go.mod +++ b/go.mod @@ -5,21 +5,22 @@ go 1.19 require ( github.com/SSSaaS/sssa-golang v0.0.0-20170502204618-d37d7782d752 github.com/miscreant/miscreant.go v0.0.0-20200214223636-26d376326b75 - github.com/ovh/configstore v0.3.3-0.20200701085609-a539fcf61db5 + github.com/ovh/configstore v0.6.1 github.com/pelletier/go-toml v1.8.0 github.com/stretchr/testify v1.6.1 - golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 + golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be gopkg.in/alecthomas/kingpin.v2 v2.2.6 - gopkg.in/yaml.v2 v2.3.0 + gopkg.in/yaml.v2 v2.4.0 ) require ( github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect - github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect + github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c // indirect + golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec // indirect gopkg.in/check.v1 v1.0.0-20160105164936-4f90aeace3a2 // indirect gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect ) diff --git a/go.sum b/go.sum index 0541732..e3d3407 100644 --- a/go.sum +++ b/go.sum @@ -4,17 +4,20 @@ github.com/SSSaaS/sssa-golang v0.0.0-20170502204618-d37d7782d752 h1:NMpC6M+PtNND github.com/SSSaaS/sssa-golang v0.0.0-20170502204618-d37d7782d752/go.mod h1:PbJ8S5YaSYAvDPTiEuUsBHQwTUlPs6VM+Av8Oi3v570= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc= +github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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= +github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= +github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/miscreant/miscreant.go v0.0.0-20200214223636-26d376326b75 h1:cUVxyR+UfmdEAZGJ8IiKld1O0dbGotEnkMolG5hfMSY= github.com/miscreant/miscreant.go v0.0.0-20200214223636-26d376326b75/go.mod h1:pBbZyGwC5i16IBkjVKoy/sznA8jPD/K9iedwe1ESE6w= -github.com/ovh/configstore v0.3.3-0.20200701085609-a539fcf61db5 h1:E5fS/QLKUEcInoJFtM3K5+6pVVTqKxwR5boVb5oZ02c= -github.com/ovh/configstore v0.3.3-0.20200701085609-a539fcf61db5/go.mod h1:IXY5qFC5mqMIFPXZjeZiAz/qIt+mO6F6SmsOCf/yits= +github.com/ovh/configstore v0.6.1 h1:EZg9Bgw6gm8zXkCjFxVqi4STE4spExkI1Nx0T2yMXwM= +github.com/ovh/configstore v0.6.1/go.mod h1:DU19o06umHsivDXqUXBGXiw/vTiLpADXBxkksoSz+Kc= github.com/pelletier/go-toml v1.8.0 h1:Keo9qb7iRJs2voHvunFtuuYFsbWeOBh8/P9v/kVMFtw= github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -23,22 +26,20 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 h1:DZhuSZLsGlFL4CmhA8BcRA0mnthyA/nZ00AqCUo7vHg= -golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c h1:UIcGWL6/wpCfyGuJnRFJRurA+yj8RrW7Q6x2YMCXt6c= -golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be h1:fmw3UbQh+nxngCAHrDCCztao/kbYFnWjoqop8dHx05A= +golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec h1:BkDtF2Ih9xZ7le9ndzTA7KJow28VbQW3odyk/8drmuI= +golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20160105164936-4f90aeace3a2 h1:+j1SppRob9bAgoYmsdW9NNBdKZfgYuWpqnYHv78Qt8w= gopkg.in/check.v1 v1.0.0-20160105164936-4f90aeace3a2/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From f2602acb1231a95035505451c4f018cbb8557d1e Mon Sep 17 00:00:00 2001 From: Adam Shannon Date: Thu, 13 Oct 2022 08:20:37 -0500 Subject: [PATCH 4/4] build: improvements from codereview --- .github/workflows/{go.yml => ci.yml} | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) rename .github/workflows/{go.yml => ci.yml} (58%) diff --git a/.github/workflows/go.yml b/.github/workflows/ci.yml similarity index 58% rename from .github/workflows/go.yml rename to .github/workflows/ci.yml index 627a86f..f9d5edc 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Go +name: CI on: push: @@ -17,20 +17,19 @@ jobs: - name: Set up Go 1.x uses: actions/setup-go@v2 with: - go-version: '>= 1.19.1' + go-version: '>= 1.19.2' id: go - name: Check out code into the Go module directory uses: actions/checkout@v2 - - name: Setup - run: | - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.49.0 + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: latest - name: Test - run: | - golangci-lint run # run a bunch of code checkers/linters in parallel - go test -v -race ./... # Run all the tests with the race detector enabled + run: go test -v -race ./... - name: Upload Code Coverage if: runner.os == 'Linux'