diff --git a/acls.go b/acls.go index 0451a4a..ab004dc 100644 --- a/acls.go +++ b/acls.go @@ -70,7 +70,8 @@ func (c *Client) SetVolumeMode( ctx context.Context, volumeName string, mode int, ) error { - filemode := api.FileMode(mode) + // #nosec G115 + filemode := api.FileMode(uint32(mode)) return api.ACLUpdate( ctx, diff --git a/api/v2/api_v2_acls.go b/api/v2/api_v2_acls.go index e82507a..6582a9c 100644 --- a/api/v2/api_v2_acls.go +++ b/api/v2/api_v2_acls.go @@ -194,7 +194,8 @@ func (p *FileMode) UnmarshalText(data []byte) error { if err != nil { return err } - *p = FileMode(m) + // #nosec G115 + *p = FileMode(uint32(m)) return nil } diff --git a/client.go b/client.go index e31dd4f..02a2f1b 100644 --- a/client.go +++ b/client.go @@ -44,6 +44,7 @@ func NewClient(ctx context.Context) (*Client, error) { if err != nil { return nil, err } + // #nosec G115 return NewClientWithArgs( ctx, os.Getenv("GOISILON_ENDPOINT"), diff --git a/goisilon_test.go b/goisilon_test.go index bc2a5d7..3a5150c 100644 --- a/goisilon_test.go +++ b/goisilon_test.go @@ -73,6 +73,7 @@ func TestMain(m *testing.M) { log.WithError(err).Panic(defaultCtx, "error fetching environment variable GOISILON_AUTHTYPE") } + // #nosec G115 client, err = NewClientWithArgs( defaultCtx, os.Getenv("GOISILON_ENDPOINT"), diff --git a/role_test.go b/role_test.go index 66f5f31..2f137ab 100644 --- a/role_test.go +++ b/role_test.go @@ -96,6 +96,7 @@ func TestRoleMemberAdd(t *testing.T) { // add/remove role member by uid uid, err := strconv.ParseInt(user.Uid.Id[4:], 10, 32) + // #nosec G115 uid32 := int32(uid) if err != nil { panic(err) diff --git a/snapshots_test.go b/snapshots_test.go index b3e61c7..40a9df5 100644 --- a/snapshots_test.go +++ b/snapshots_test.go @@ -514,7 +514,7 @@ func TestGetRealVolumeSnapshotPathWithIsiPath(_ *testing.T) { newIsiPath := os.Getenv("GOISILON_VOLUMEPATH") accessZone := "System" name := "snapshottest" - fmt.Printf(apiv1.GetRealVolumeSnapshotPathWithIsiPath(newIsiPath, volName, name, accessZone)) + fmt.Println(apiv1.GetRealVolumeSnapshotPathWithIsiPath(newIsiPath, volName, name, accessZone)) } func TestSnapshotSizeGet(_ *testing.T) { diff --git a/user_group_test.go b/user_group_test.go index 0db7dc6..a567367 100644 --- a/user_group_test.go +++ b/user_group_test.go @@ -63,6 +63,7 @@ func TestGroupCreate(t *testing.T) { panic(err) } uid, err := strconv.ParseInt(user.Uid.Id[4:], 10, 32) + // #nosec G115 uid32 := int32(uid) if err != nil { panic(err)