Skip to content

Commit

Permalink
Address lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
falfaroc committed Oct 7, 2024
1 parent 3e29d95 commit c1fb1cb
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion acls.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion api/v2/api_v2_acls.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
1 change: 1 addition & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
1 change: 1 addition & 0 deletions goisilon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
1 change: 1 addition & 0 deletions role_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion snapshots_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions user_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c1fb1cb

Please sign in to comment.