Skip to content

Commit 33db64f

Browse files
authored
Merge pull request dell#46 from dell/add-go-version-workflow
Add go version workflow
2 parents 7054a34 + 583b663 commit 33db64f

File tree

3 files changed

+32
-4
lines changed

3 files changed

+32
-4
lines changed

.github/workflows/go-version.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
9+
# Reusable workflow to perform go version update on Golang based projects
10+
name: Go Version Update
11+
12+
on:
13+
workflow_dispatch:
14+
repository_dispatch:
15+
types: [go-update-workflow]
16+
17+
jobs:
18+
# go version update
19+
go-version-update:
20+
uses: dell/common-github-actions/.github/workflows/go-version-workflow.yaml@main
21+
name: Go Version Update
22+
secrets: inherit

gofsutil_fs.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,21 @@ func (fs *FS) fsInfo(_ context.Context, path string) (int64, int64, int64, int64
192192
}
193193

194194
// Available is blocks available * fragment size
195-
available := int64(statfs.Bavail) * int64(statfs.Bsize)
195+
// #nosec G115
196+
available := int64(statfs.Bavail) * statfs.Bsize
196197

197198
// Capacity is total block count * fragment size
198-
capacity := int64(statfs.Blocks) * int64(statfs.Bsize)
199+
// #nosec G115
200+
capacity := int64(statfs.Blocks) * statfs.Bsize
199201

200202
// Usage is block being used * fragment size (aka block size).
201-
usage := (int64(statfs.Blocks) - int64(statfs.Bfree)) * int64(statfs.Bsize)
203+
// #nosec G115
204+
usage := (int64(statfs.Blocks) - int64(statfs.Bfree)) * statfs.Bsize
202205

206+
// #nosec G115
203207
inodes := int64(statfs.Files)
208+
209+
// #nosec G115
204210
inodesFree := int64(statfs.Ffree)
205211
inodesUsed := inodes - inodesFree
206212

gofsutil_mount_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ func (fs *FS) multipathCommand(ctx context.Context, timeoutSeconds time.Duration
571571
log.Error("multipath command failed: " + err.Error())
572572
}
573573
if len(textBytes) > 0 {
574-
log.Debug(fmt.Printf("multipath output: " + string(textBytes)))
574+
log.Debug(fmt.Printf("multipath output: %s", string(textBytes)))
575575
}
576576
return textBytes, err
577577
}

0 commit comments

Comments
 (0)