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

[disk][host]: move back Warnings from internal to disk and host. #1379

Merged
merged 2 commits into from Nov 30, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion disk/disk_windows.go
Expand Up @@ -15,6 +15,8 @@ import (
"golang.org/x/sys/windows/registry"
)

type Warnings = common.Warnings

var (
procGetDiskFreeSpaceExW = common.Modkernel32.NewProc("GetDiskFreeSpaceExW")
procGetLogicalDriveStringsW = common.Modkernel32.NewProc("GetLogicalDriveStringsW")
Expand Down Expand Up @@ -80,7 +82,7 @@ func UsageWithContext(ctx context.Context, path string) (*UsageStat, error) {
}

func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, error) {
warnings := common.Warnings{
warnings := Warnings{
Verbose: true,
}
var ret []PartitionStat
Expand Down
4 changes: 3 additions & 1 deletion host/host_linux.go
Expand Up @@ -19,6 +19,8 @@ import (
"golang.org/x/sys/unix"
)

type Warnings = common.Warnings

type lsbStruct struct {
ID string
Release string
Expand Down Expand Up @@ -395,7 +397,7 @@ func SensorsTemperaturesWithContext(ctx context.Context) ([]TemperatureStat, err
}
}

var warns common.Warnings
var warns Warnings

if len(files) == 0 { // handle distributions without hwmon, like raspbian #391, parse legacy thermal_zone files
files, err = filepath.Glob(common.HostSys("/class/thermal/thermal_zone*/"))
Expand Down