Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add go version workflow #46

Merged
merged 2 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/go-version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0

# Reusable workflow to perform go version update on Golang based projects
name: Go Version Update

on:
workflow_dispatch:
repository_dispatch:
types: [go-update-workflow]

jobs:
# go version update
go-version-update:
uses: dell/common-github-actions/.github/workflows/go-version-workflow.yaml@main
name: Go Version Update
secrets: inherit
12 changes: 9 additions & 3 deletions gofsutil_fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,21 @@ func (fs *FS) fsInfo(_ context.Context, path string) (int64, int64, int64, int64
}

// Available is blocks available * fragment size
available := int64(statfs.Bavail) * int64(statfs.Bsize)
// #nosec G115
available := int64(statfs.Bavail) * statfs.Bsize

// Capacity is total block count * fragment size
capacity := int64(statfs.Blocks) * int64(statfs.Bsize)
// #nosec G115
capacity := int64(statfs.Blocks) * statfs.Bsize

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

// #nosec G115
inodes := int64(statfs.Files)

// #nosec G115
inodesFree := int64(statfs.Ffree)
inodesUsed := inodes - inodesFree

Expand Down
2 changes: 1 addition & 1 deletion gofsutil_mount_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ func (fs *FS) multipathCommand(ctx context.Context, timeoutSeconds time.Duration
log.Error("multipath command failed: " + err.Error())
}
if len(textBytes) > 0 {
log.Debug(fmt.Printf("multipath output: " + string(textBytes)))
log.Debug(fmt.Printf("multipath output: %s", string(textBytes)))
}
return textBytes, err
}
Expand Down