From 67ccd83579c48739270eafa6995d7864d7f80eae Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Thu, 21 Nov 2019 12:50:27 +0300 Subject: [PATCH 1/3] ci: integrate GitHub Actions --- .github/workflows/go.yml | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/go.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..de59f36 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,41 @@ +name: Go +on: [push] +jobs: + + test: + name: test + runs-on: ubuntu-latest + strategy: + matrix: + go: [ '1.11.x', '1.12.x', '1.13.x'] + steps: + + - name: Setup go + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go }} + + - name: Check out code into the Go module directory + uses: actions/checkout@v1 + + - name: Set GOPATH + # temporary fix + # see https://github.com/actions/setup-go/issues/14 + run: | + echo "##[set-env name=GOPATH;]$(dirname $GITHUB_WORKSPACE)" + echo "##[add-path]$(dirname $GITHUB_WORKSPACE)/bin" + shell: bash + + - name: Get dependencies + run: | + go get -u -v golang.org/x/lint/golint + go mod tidy -v + + - name: Linter + run: golint -set_exit_status ./... + + - name: Tests + run: go test -coverprofile=coverage.txt -covermode=atomic ./... + + - name: Codecov + run: bash <(curl -s https://codecov.io/bash) From a6c563e039919ec7947651fcb920fb0c17f24e7c Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Thu, 21 Nov 2019 12:34:18 +0300 Subject: [PATCH 2/3] linter: remove unused --- proto.go | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 proto.go diff --git a/proto.go b/proto.go deleted file mode 100644 index b15f22a..0000000 --- a/proto.go +++ /dev/null @@ -1,7 +0,0 @@ -package neofs_proto // import "github.com/nspcc-dev/neofs-proto" - -import ( - _ "github.com/gogo/protobuf/gogoproto" - _ "github.com/gogo/protobuf/proto" - _ "github.com/golang/protobuf/proto" -) From 165dc9abd7fa6e64b73ce526811bd7b21886f53e Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Thu, 21 Nov 2019 12:34:54 +0300 Subject: [PATCH 3/3] linter: fix doc comments issues --- container/service.go | 2 +- container/types.go | 2 +- session/types.go | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/container/service.go b/container/service.go index 527377a..27f39e7 100644 --- a/container/service.go +++ b/container/service.go @@ -15,7 +15,7 @@ type ( UUID = refs.UUID // OwnerID type alias. OwnerID = refs.OwnerID - // OwnerID type alias. + // MessageID type alias. MessageID = refs.MessageID ) diff --git a/container/types.go b/container/types.go index 1ffcafe..9269f30 100644 --- a/container/types.go +++ b/container/types.go @@ -68,8 +68,8 @@ func (m *Container) Empty() bool { } // -- Test container definition -- // + // NewTestContainer returns test container. -// // WARNING: DON'T USE THIS OUTSIDE TESTS. func NewTestContainer() (*Container, error) { key := test.DecodeKey(0) diff --git a/session/types.go b/session/types.go index ceb2944..aff7cca 100644 --- a/session/types.go +++ b/session/types.go @@ -124,7 +124,7 @@ func (m *Token) Verify(keys ...*ecdsa.PublicKey) bool { return false } -// Sign adds token signatures. +// AddSignatures adds token signatures. func (t *PToken) AddSignatures(signH, signT []byte) { t.mtx.Lock() @@ -139,8 +139,7 @@ func (t *PToken) SignData(data []byte) ([]byte, error) { return crypto.Sign(t.PrivateKey, data) } -// VerifyData checks if signature of data by token t -// is equal to sign. +// VerifyData checks if signature of data by token is equal to sign. func (m *VerificationHeader) VerifyData(data, sign []byte) error { if crypto.Verify(crypto.UnmarshalPublicKey(m.PublicKey), data, sign) != nil { return ErrInvalidSignature