From c42cba16bfdfbdb41968d0fad10830fb51607713 Mon Sep 17 00:00:00 2001 From: Fernando Alfaro Campos Date: Fri, 4 Oct 2024 15:20:39 -0400 Subject: [PATCH 1/2] Add go version update worklow --- .github/workflows/go-version.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/go-version.yaml diff --git a/.github/workflows/go-version.yaml b/.github/workflows/go-version.yaml new file mode 100644 index 0000000..1ba387e --- /dev/null +++ b/.github/workflows/go-version.yaml @@ -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 From 583b66393449e03a38df7a8e5fae7fad8c571cc7 Mon Sep 17 00:00:00 2001 From: Fernando Alfaro Campos Date: Mon, 7 Oct 2024 10:58:25 -0400 Subject: [PATCH 2/2] Address lint errors --- gofsutil_fs.go | 12 +++++++++--- gofsutil_mount_unix.go | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gofsutil_fs.go b/gofsutil_fs.go index 94bf4ec..c4152a0 100644 --- a/gofsutil_fs.go +++ b/gofsutil_fs.go @@ -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 diff --git a/gofsutil_mount_unix.go b/gofsutil_mount_unix.go index 0ea5ad4..ac218f7 100644 --- a/gofsutil_mount_unix.go +++ b/gofsutil_mount_unix.go @@ -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 }