forked from TrueCloudLab/frostfs-api-go
Merge branch 'release/0.4.2'
This commit is contained in:
commit
5302b8593b
4 changed files with 63 additions and 4 deletions
26
.github/workflows/go.yml
vendored
26
.github/workflows/go.yml
vendored
|
@ -1,5 +1,17 @@
|
||||||
name: Go
|
name: Go
|
||||||
on: [push]
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- develop
|
||||||
|
paths-ignore:
|
||||||
|
- '*.md'
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- develop
|
||||||
|
paths-ignore:
|
||||||
|
- '*.md'
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
test:
|
test:
|
||||||
|
@ -7,16 +19,17 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go: [ '1.11.x', '1.12.x', '1.13.x']
|
go: [ '1.12.x', '1.13.x', '1.14.x']
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Setup go
|
- name: Setup go
|
||||||
uses: actions/setup-go@v1
|
uses: actions/setup-go@v1
|
||||||
with:
|
with:
|
||||||
go-version: ${{ matrix.go }}
|
go-version: ${{ matrix.go }}
|
||||||
|
id: go
|
||||||
|
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Set GOPATH
|
- name: Set GOPATH
|
||||||
# temporary fix
|
# temporary fix
|
||||||
|
@ -26,6 +39,13 @@ jobs:
|
||||||
echo "##[add-path]$(dirname $GITHUB_WORKSPACE)/bin"
|
echo "##[add-path]$(dirname $GITHUB_WORKSPACE)/bin"
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
- uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ~/go/pkg/mod
|
||||||
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-go-
|
||||||
|
|
||||||
- name: Get dependencies
|
- name: Get dependencies
|
||||||
run: |
|
run: |
|
||||||
go get -u -v golang.org/x/lint/golint
|
go get -u -v golang.org/x/lint/golint
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
This is the changelog for NeoFS API
|
This is the changelog for NeoFS API
|
||||||
|
|
||||||
|
## [0.4.2] - 2020-03-16
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- NPE bug with CID method of object.PutRequest
|
||||||
|
|
||||||
## [0.4.1] - 2020-03-02
|
## [0.4.1] - 2020-03-02
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
@ -204,3 +209,4 @@ Initial public release
|
||||||
[0.3.2]: https://github.com/nspcc-dev/neofs-api/compare/v0.3.1...v0.3.2
|
[0.3.2]: https://github.com/nspcc-dev/neofs-api/compare/v0.3.1...v0.3.2
|
||||||
[0.4.0]: https://github.com/nspcc-dev/neofs-api/compare/v0.3.2...v0.4.0
|
[0.4.0]: https://github.com/nspcc-dev/neofs-api/compare/v0.3.2...v0.4.0
|
||||||
[0.4.1]: https://github.com/nspcc-dev/neofs-api/compare/v0.4.0...v0.4.1
|
[0.4.1]: https://github.com/nspcc-dev/neofs-api/compare/v0.4.0...v0.4.1
|
||||||
|
[0.4.2]: https://github.com/nspcc-dev/neofs-api/compare/v0.4.1...v0.4.2
|
||||||
|
|
|
@ -124,7 +124,12 @@ func (m *GetResponse) NotFull() bool { return checkIsNotFull(m) }
|
||||||
func (m *PutRequest) NotFull() bool { return checkIsNotFull(m) }
|
func (m *PutRequest) NotFull() bool { return checkIsNotFull(m) }
|
||||||
|
|
||||||
// CID returns container id value from object put request.
|
// CID returns container id value from object put request.
|
||||||
func (m *PutRequest) CID() CID { return m.GetHeader().Object.SystemHeader.CID }
|
func (m *PutRequest) CID() CID {
|
||||||
|
if header := m.GetHeader(); header != nil {
|
||||||
|
return header.Object.SystemHeader.CID
|
||||||
|
}
|
||||||
|
return refs.CID{}
|
||||||
|
}
|
||||||
|
|
||||||
// CID returns container id value from object get request.
|
// CID returns container id value from object get request.
|
||||||
func (m *GetRequest) CID() CID { return m.Address.CID }
|
func (m *GetRequest) CID() CID { return m.Address.CID }
|
||||||
|
|
28
object/service_test.go
Normal file
28
object/service_test.go
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
package object
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestRequest(t *testing.T) {
|
||||||
|
cases := []Request{
|
||||||
|
&PutRequest{},
|
||||||
|
&GetRequest{},
|
||||||
|
&HeadRequest{},
|
||||||
|
&SearchRequest{},
|
||||||
|
&DeleteRequest{},
|
||||||
|
&GetRangeRequest{},
|
||||||
|
&GetRangeHashRequest{},
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := range cases {
|
||||||
|
v := cases[i]
|
||||||
|
|
||||||
|
t.Run(fmt.Sprintf("%T", v), func(t *testing.T) {
|
||||||
|
require.NotPanics(t, func() { v.CID() })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue