Merge pull request #1379 from shirou/feature/revert_errors_from_internal

[disk][host]: move back Warnings from internal to disk and host.
feature/fix_type_alias_warning
shirou 2 years ago committed by GitHub
commit 9fc4d70059
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -15,6 +15,8 @@ import (
"golang.org/x/sys/windows/registry" "golang.org/x/sys/windows/registry"
) )
type Warnings = common.Warnings
var ( var (
procGetDiskFreeSpaceExW = common.Modkernel32.NewProc("GetDiskFreeSpaceExW") procGetDiskFreeSpaceExW = common.Modkernel32.NewProc("GetDiskFreeSpaceExW")
procGetLogicalDriveStringsW = common.Modkernel32.NewProc("GetLogicalDriveStringsW") procGetLogicalDriveStringsW = common.Modkernel32.NewProc("GetLogicalDriveStringsW")
@ -80,7 +82,7 @@ func UsageWithContext(ctx context.Context, path string) (*UsageStat, error) {
} }
func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, error) { func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, error) {
warnings := common.Warnings{ warnings := Warnings{
Verbose: true, Verbose: true,
} }
var ret []PartitionStat var ret []PartitionStat

@ -19,6 +19,8 @@ import (
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )
type Warnings = common.Warnings
type lsbStruct struct { type lsbStruct struct {
ID string ID string
Release string Release string
@ -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 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*/")) files, err = filepath.Glob(common.HostSys("/class/thermal/thermal_zone*/"))

Loading…
Cancel
Save