fix: moves common.Warnings to common OS files

This allows all OS types to unwrap the Warnings from errors, and not
just linux in host or windows in disk.

fixes: #1429
pull/1431/head
Josh Powers 2 years ago
parent c7c548d6bd
commit e7c6b6991d
No known key found for this signature in database
GPG Key ID: A2FA14A470214D78

@ -9,6 +9,8 @@ import (
var invoke common.Invoker = common.Invoke{} var invoke common.Invoker = common.Invoke{}
type Warnings = common.Warnings
type UsageStat struct { type UsageStat struct {
Path string `json:"path"` Path string `json:"path"`
Fstype string `json:"fstype"` Fstype string `json:"fstype"`

@ -15,8 +15,6 @@ 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")

@ -11,6 +11,8 @@ import (
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v3/internal/common"
) )
type Warnings = common.Warnings
var invoke common.Invoker = common.Invoke{} var invoke common.Invoker = common.Invoke{}
// A HostInfoStat describes the host status. // A HostInfoStat describes the host status.

@ -19,8 +19,6 @@ 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

Loading…
Cancel
Save