Skip to content

Commit

Permalink
Merge pull request #1379 from shirou/feature/revert_errors_from_internal
Browse files Browse the repository at this point in the history
[disk][host]: move back Warnings from internal to disk and host.
  • Loading branch information
shirou committed Nov 30, 2022
2 parents ea7607e + 5473fd1 commit 9fc4d70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
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

0 comments on commit 9fc4d70

Please sign in to comment.