Skip to content

Commit

Permalink
fix: moves common.Warnings to common OS files
Browse files Browse the repository at this point in the history
This allows all OS types to unwrap the Warnings from errors, and not
just linux in host or windows in disk.

fixes: #1429
  • Loading branch information
powersj committed Mar 15, 2023
1 parent c7c548d commit e7c6b69
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 2 additions & 0 deletions disk/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (

var invoke common.Invoker = common.Invoke{}

type Warnings = common.Warnings

type UsageStat struct {
Path string `json:"path"`
Fstype string `json:"fstype"`
Expand Down
2 changes: 0 additions & 2 deletions disk/disk_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import (
"golang.org/x/sys/windows/registry"
)

type Warnings = common.Warnings

var (
procGetDiskFreeSpaceExW = common.Modkernel32.NewProc("GetDiskFreeSpaceExW")
procGetLogicalDriveStringsW = common.Modkernel32.NewProc("GetLogicalDriveStringsW")
Expand Down
2 changes: 2 additions & 0 deletions host/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"github.com/shirou/gopsutil/v3/internal/common"
)

type Warnings = common.Warnings

var invoke common.Invoker = common.Invoke{}

// A HostInfoStat describes the host status.
Expand Down
2 changes: 0 additions & 2 deletions host/host_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import (
"golang.org/x/sys/unix"
)

type Warnings = common.Warnings

type lsbStruct struct {
ID string
Release string
Expand Down

0 comments on commit e7c6b69

Please sign in to comment.