forked from TrueCloudLab/frostfs-api-go
initial
This commit is contained in:
commit
1cf33e5ffd
87 changed files with 29835 additions and 0 deletions
14
refs/sgid.go
Normal file
14
refs/sgid.go
Normal file
|
@ -0,0 +1,14 @@
|
|||
package refs
|
||||
|
||||
import (
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// SGIDFromBytes parse bytes representation of SGID into new SGID value.
|
||||
func SGIDFromBytes(data []byte) (sgid SGID, err error) {
|
||||
if ln := len(data); ln != SGIDSize {
|
||||
return SGID{}, errors.Wrapf(ErrWrongDataSize, "expect=%d, actual=%d", SGIDSize, ln)
|
||||
}
|
||||
copy(sgid[:], data)
|
||||
return
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue