diff --git a/README.md b/README.md index f6e118272..5a8dc398c 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,13 @@ This is a port of psutil (https://github.com/giampaolo/psutil). The challenge is porting all psutil functions on some architectures. -## v3 migration +## migration + +### v4 migration + +See v4 release note. + +### v3 migration From v3.20.10, gopsutil becomes v3 which breaks backwards compatibility. See [v3Changes.md](_tools/v3migration/v3Changes.md) for more detailed changes. @@ -15,10 +21,10 @@ See [v3Changes.md](_tools/v3migration/v3Changes.md) for more detailed changes. gopsutil tag policy is almost same as Semantic Versioning, but automatically increases like [Ubuntu versioning](https://calver.org/). -For example, v2.17.04 means +For example, v4.24.04 means -- v2: major version -- 17: release year, 2017 +- v4: major version +- 24: release year, 2024 - 04: release month gopsutil aims to keep backwards compatibility until major version change. @@ -52,7 +58,7 @@ package main import ( "fmt" - "github.com/shirou/gopsutil/v3/mem" + "github.com/shirou/gopsutil/v4/mem" // "github.com/shirou/gopsutil/mem" // to use v2 ) @@ -122,11 +128,11 @@ Be very careful that enabling the cache may cause inconsistencies. For example, ## Documentation -See https://pkg.go.dev/github.com/shirou/gopsutil/v3 or https://godocs.io/github.com/shirou/gopsutil/v3 +See https://pkg.go.dev/github.com/shirou/gopsutil/v4 or https://godocs.io/github.com/shirou/gopsutil/v4 ## Requirements -- go1.16 or above is required. +- go1.20 or above is required. ## More Info diff --git a/common/env.go b/common/env.go index 4b5f4980c..4acad1fd1 100644 --- a/common/env.go +++ b/common/env.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package common type EnvKeyType string diff --git a/cpu/cpu.go b/cpu/cpu.go index 83bc23d45..56f53c3a1 100644 --- a/cpu/cpu.go +++ b/cpu/cpu.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu import ( @@ -11,7 +12,7 @@ import ( "sync" "time" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) // TimesStat contains the amounts of time the CPU has spent performing different diff --git a/cpu/cpu_aix.go b/cpu/cpu_aix.go index 1439d1d79..bc766bd4f 100644 --- a/cpu/cpu_aix.go +++ b/cpu/cpu_aix.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build aix -// +build aix package cpu diff --git a/cpu/cpu_aix_cgo.go b/cpu/cpu_aix_cgo.go index 9c1e70b17..559dc5fea 100644 --- a/cpu/cpu_aix_cgo.go +++ b/cpu/cpu_aix_cgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build aix && cgo -// +build aix,cgo package cpu diff --git a/cpu/cpu_aix_nocgo.go b/cpu/cpu_aix_nocgo.go index a77b4dbb7..51e295a2b 100644 --- a/cpu/cpu_aix_nocgo.go +++ b/cpu/cpu_aix_nocgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build aix && !cgo -// +build aix,!cgo package cpu @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func TimesWithContext(ctx context.Context, percpu bool) ([]TimesStat, error) { diff --git a/cpu/cpu_darwin.go b/cpu/cpu_darwin.go index 41f395e5e..79a458b8e 100644 --- a/cpu/cpu_darwin.go +++ b/cpu/cpu_darwin.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin -// +build darwin package cpu diff --git a/cpu/cpu_darwin_cgo.go b/cpu/cpu_darwin_cgo.go index 1d5f0772e..3a02024c5 100644 --- a/cpu/cpu_darwin_cgo.go +++ b/cpu/cpu_darwin_cgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin && cgo -// +build darwin,cgo package cpu diff --git a/cpu/cpu_darwin_nocgo.go b/cpu/cpu_darwin_nocgo.go index e067e99f9..1af8566a6 100644 --- a/cpu/cpu_darwin_nocgo.go +++ b/cpu/cpu_darwin_nocgo.go @@ -1,9 +1,9 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin && !cgo -// +build darwin,!cgo package cpu -import "github.com/shirou/gopsutil/v3/internal/common" +import "github.com/shirou/gopsutil/v4/internal/common" func perCPUTimes() ([]TimesStat, error) { return []TimesStat{}, common.ErrNotImplementedError diff --git a/cpu/cpu_darwin_test.go b/cpu/cpu_darwin_test.go index 57b3d66ee..ee1d7a58d 100644 --- a/cpu/cpu_darwin_test.go +++ b/cpu/cpu_darwin_test.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin -// +build darwin package cpu diff --git a/cpu/cpu_dragonfly.go b/cpu/cpu_dragonfly.go index fef53e5dc..19b1e9dd3 100644 --- a/cpu/cpu_dragonfly.go +++ b/cpu/cpu_dragonfly.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu import ( @@ -10,7 +11,7 @@ import ( "strings" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "github.com/tklauser/go-sysconf" "golang.org/x/sys/unix" ) diff --git a/cpu/cpu_dragonfly_amd64.go b/cpu/cpu_dragonfly_amd64.go index 57e14528d..25ececa68 100644 --- a/cpu/cpu_dragonfly_amd64.go +++ b/cpu/cpu_dragonfly_amd64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu type cpuTimes struct { diff --git a/cpu/cpu_fallback.go b/cpu/cpu_fallback.go index 089f603c8..245c1ec98 100644 --- a/cpu/cpu_fallback.go +++ b/cpu/cpu_fallback.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build !darwin && !linux && !freebsd && !openbsd && !netbsd && !solaris && !windows && !dragonfly && !plan9 && !aix -// +build !darwin,!linux,!freebsd,!openbsd,!netbsd,!solaris,!windows,!dragonfly,!plan9,!aix package cpu @@ -7,7 +7,7 @@ import ( "context" "runtime" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func Times(percpu bool) ([]TimesStat, error) { diff --git a/cpu/cpu_freebsd.go b/cpu/cpu_freebsd.go index d3f47353c..c68d6bff0 100644 --- a/cpu/cpu_freebsd.go +++ b/cpu/cpu_freebsd.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu import ( @@ -10,7 +11,7 @@ import ( "strings" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "github.com/tklauser/go-sysconf" "golang.org/x/sys/unix" ) diff --git a/cpu/cpu_freebsd_386.go b/cpu/cpu_freebsd_386.go index 8b7f4c321..e4799bcf5 100644 --- a/cpu/cpu_freebsd_386.go +++ b/cpu/cpu_freebsd_386.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu type cpuTimes struct { diff --git a/cpu/cpu_freebsd_amd64.go b/cpu/cpu_freebsd_amd64.go index 57e14528d..25ececa68 100644 --- a/cpu/cpu_freebsd_amd64.go +++ b/cpu/cpu_freebsd_amd64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu type cpuTimes struct { diff --git a/cpu/cpu_freebsd_arm.go b/cpu/cpu_freebsd_arm.go index 8b7f4c321..e4799bcf5 100644 --- a/cpu/cpu_freebsd_arm.go +++ b/cpu/cpu_freebsd_arm.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu type cpuTimes struct { diff --git a/cpu/cpu_freebsd_arm64.go b/cpu/cpu_freebsd_arm64.go index 57e14528d..25ececa68 100644 --- a/cpu/cpu_freebsd_arm64.go +++ b/cpu/cpu_freebsd_arm64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu type cpuTimes struct { diff --git a/cpu/cpu_freebsd_test.go b/cpu/cpu_freebsd_test.go index 27a709d31..33334f879 100644 --- a/cpu/cpu_freebsd_test.go +++ b/cpu/cpu_freebsd_test.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu import ( @@ -5,7 +6,7 @@ import ( "runtime" "testing" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func TestParseDmesgBoot(t *testing.T) { diff --git a/cpu/cpu_linux.go b/cpu/cpu_linux.go index da467e2dd..f78c61a25 100644 --- a/cpu/cpu_linux.go +++ b/cpu/cpu_linux.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux -// +build linux package cpu @@ -13,7 +13,7 @@ import ( "github.com/tklauser/go-sysconf" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) var ClocksPerSec = float64(100) diff --git a/cpu/cpu_linux_test.go b/cpu/cpu_linux_test.go index e06f30520..644d25f57 100644 --- a/cpu/cpu_linux_test.go +++ b/cpu/cpu_linux_test.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu import ( diff --git a/cpu/cpu_netbsd.go b/cpu/cpu_netbsd.go index 1f66be342..2cda5cd24 100644 --- a/cpu/cpu_netbsd.go +++ b/cpu/cpu_netbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build netbsd -// +build netbsd package cpu @@ -9,7 +9,7 @@ import ( "runtime" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "github.com/tklauser/go-sysconf" "golang.org/x/sys/unix" ) diff --git a/cpu/cpu_netbsd_amd64.go b/cpu/cpu_netbsd_amd64.go index 57e14528d..25ececa68 100644 --- a/cpu/cpu_netbsd_amd64.go +++ b/cpu/cpu_netbsd_amd64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu type cpuTimes struct { diff --git a/cpu/cpu_netbsd_arm64.go b/cpu/cpu_netbsd_arm64.go index 57e14528d..25ececa68 100644 --- a/cpu/cpu_netbsd_arm64.go +++ b/cpu/cpu_netbsd_arm64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu type cpuTimes struct { diff --git a/cpu/cpu_openbsd.go b/cpu/cpu_openbsd.go index fe3329030..33233d3c7 100644 --- a/cpu/cpu_openbsd.go +++ b/cpu/cpu_openbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd -// +build openbsd package cpu @@ -9,7 +9,7 @@ import ( "runtime" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "github.com/tklauser/go-sysconf" "golang.org/x/sys/unix" ) diff --git a/cpu/cpu_openbsd_386.go b/cpu/cpu_openbsd_386.go index 5e878399a..40a6f43e4 100644 --- a/cpu/cpu_openbsd_386.go +++ b/cpu/cpu_openbsd_386.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu type cpuTimes struct { diff --git a/cpu/cpu_openbsd_amd64.go b/cpu/cpu_openbsd_amd64.go index d659058cd..464156d54 100644 --- a/cpu/cpu_openbsd_amd64.go +++ b/cpu/cpu_openbsd_amd64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu type cpuTimes struct { diff --git a/cpu/cpu_openbsd_arm.go b/cpu/cpu_openbsd_arm.go index 5e878399a..40a6f43e4 100644 --- a/cpu/cpu_openbsd_arm.go +++ b/cpu/cpu_openbsd_arm.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu type cpuTimes struct { diff --git a/cpu/cpu_openbsd_arm64.go b/cpu/cpu_openbsd_arm64.go index d659058cd..464156d54 100644 --- a/cpu/cpu_openbsd_arm64.go +++ b/cpu/cpu_openbsd_arm64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu type cpuTimes struct { diff --git a/cpu/cpu_openbsd_riscv64.go b/cpu/cpu_openbsd_riscv64.go index d659058cd..464156d54 100644 --- a/cpu/cpu_openbsd_riscv64.go +++ b/cpu/cpu_openbsd_riscv64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu type cpuTimes struct { diff --git a/cpu/cpu_plan9.go b/cpu/cpu_plan9.go index a2e99d8c0..bff2e0c75 100644 --- a/cpu/cpu_plan9.go +++ b/cpu/cpu_plan9.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build plan9 -// +build plan9 package cpu @@ -9,7 +9,7 @@ import ( "runtime" stats "github.com/lufia/plan9stats" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func Times(percpu bool) ([]TimesStat, error) { diff --git a/cpu/cpu_plan9_test.go b/cpu/cpu_plan9_test.go index 2820a3f41..9413e2aea 100644 --- a/cpu/cpu_plan9_test.go +++ b/cpu/cpu_plan9_test.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build plan9 -// +build plan9 package cpu diff --git a/cpu/cpu_solaris.go b/cpu/cpu_solaris.go index 4231ad168..d8ba1d324 100644 --- a/cpu/cpu_solaris.go +++ b/cpu/cpu_solaris.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu import ( diff --git a/cpu/cpu_solaris_test.go b/cpu/cpu_solaris_test.go index dd9362c3a..527d98541 100644 --- a/cpu/cpu_solaris_test.go +++ b/cpu/cpu_solaris_test.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu import ( diff --git a/cpu/cpu_test.go b/cpu/cpu_test.go index 688660a1a..4e9f964d4 100644 --- a/cpu/cpu_test.go +++ b/cpu/cpu_test.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu import ( @@ -10,7 +11,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func skipIfNotImplementedErr(t *testing.T, err error) { diff --git a/cpu/cpu_windows.go b/cpu/cpu_windows.go index e10612fd1..c9136b75d 100644 --- a/cpu/cpu_windows.go +++ b/cpu/cpu_windows.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build windows -// +build windows package cpu @@ -8,7 +8,7 @@ import ( "fmt" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "github.com/yusufpapurcu/wmi" "golang.org/x/sys/windows" ) diff --git a/disk/disk.go b/disk/disk.go index 0d4b25345..310ea04f1 100644 --- a/disk/disk.go +++ b/disk/disk.go @@ -1,10 +1,11 @@ +// SPDX-License-Identifier: BSD-3-Clause package disk import ( "context" "encoding/json" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) var invoke common.Invoker = common.Invoke{} diff --git a/disk/disk_aix.go b/disk/disk_aix.go index bc71712ea..c07c6adee 100644 --- a/disk/disk_aix.go +++ b/disk/disk_aix.go @@ -1,12 +1,12 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build aix -// +build aix package disk import ( "context" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func IOCountersWithContext(ctx context.Context, names ...string) (map[string]IOCountersStat, error) { diff --git a/disk/disk_aix_cgo.go b/disk/disk_aix_cgo.go index aa534df30..a0d0829f9 100644 --- a/disk/disk_aix_cgo.go +++ b/disk/disk_aix_cgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build aix && cgo -// +build aix,cgo package disk diff --git a/disk/disk_aix_nocgo.go b/disk/disk_aix_nocgo.go index 17e2b9c84..58f32defc 100644 --- a/disk/disk_aix_nocgo.go +++ b/disk/disk_aix_nocgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build aix && !cgo -// +build aix,!cgo package disk @@ -8,7 +8,7 @@ import ( "regexp" "strings" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "golang.org/x/sys/unix" ) diff --git a/disk/disk_darwin.go b/disk/disk_darwin.go index 9362d9e5d..6ed7400e2 100644 --- a/disk/disk_darwin.go +++ b/disk/disk_darwin.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin -// +build darwin package disk @@ -8,7 +8,7 @@ import ( "golang.org/x/sys/unix" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) // PartitionsWithContext returns disk partition. diff --git a/disk/disk_darwin_cgo.go b/disk/disk_darwin_cgo.go index 27c24c922..c5fcc06d7 100644 --- a/disk/disk_darwin_cgo.go +++ b/disk/disk_darwin_cgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin && cgo && !ios -// +build darwin,cgo,!ios package disk @@ -14,7 +14,7 @@ import "C" import ( "context" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func IOCountersWithContext(ctx context.Context, names ...string) (map[string]IOCountersStat, error) { diff --git a/disk/disk_darwin_nocgo.go b/disk/disk_darwin_nocgo.go index 1f099b7ca..8d55ca314 100644 --- a/disk/disk_darwin_nocgo.go +++ b/disk/disk_darwin_nocgo.go @@ -1,12 +1,12 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build (darwin && !cgo) || ios -// +build darwin,!cgo ios package disk import ( "context" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func IOCountersWithContext(ctx context.Context, names ...string) (map[string]IOCountersStat, error) { diff --git a/disk/disk_fallback.go b/disk/disk_fallback.go index 36525f694..17f0f7bf4 100644 --- a/disk/disk_fallback.go +++ b/disk/disk_fallback.go @@ -1,12 +1,12 @@ -//go:build !darwin && !linux && !freebsd && !openbsd && !netbsd && !windows && !solaris && !aix -// +build !darwin,!linux,!freebsd,!openbsd,!netbsd,!windows,!solaris,!aix +// SPDX-License-Identifier: BSD-3-Clause +//go:build !darwin && !linux && !freebsd && !openbsd && !netbsd && !windows && !solaris && !aix package disk import ( "context" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func IOCountersWithContext(ctx context.Context, names ...string) (map[string]IOCountersStat, error) { diff --git a/disk/disk_freebsd.go b/disk/disk_freebsd.go index 9b53106c2..10006febf 100644 --- a/disk/disk_freebsd.go +++ b/disk/disk_freebsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build freebsd -// +build freebsd package disk @@ -12,7 +12,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "golang.org/x/sys/unix" ) diff --git a/disk/disk_freebsd_386.go b/disk/disk_freebsd_386.go index 7fa1783dc..4660b1451 100644 --- a/disk/disk_freebsd_386.go +++ b/disk/disk_freebsd_386.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_freebsd.go diff --git a/disk/disk_freebsd_amd64.go b/disk/disk_freebsd_amd64.go index d86a308be..3f4363172 100644 --- a/disk/disk_freebsd_amd64.go +++ b/disk/disk_freebsd_amd64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_freebsd.go diff --git a/disk/disk_freebsd_arm.go b/disk/disk_freebsd_arm.go index 7fa1783dc..4660b1451 100644 --- a/disk/disk_freebsd_arm.go +++ b/disk/disk_freebsd_arm.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_freebsd.go diff --git a/disk/disk_freebsd_arm64.go b/disk/disk_freebsd_arm64.go index f6b3f80df..15fae4192 100644 --- a/disk/disk_freebsd_arm64.go +++ b/disk/disk_freebsd_arm64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build freebsd && arm64 -// +build freebsd,arm64 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs disk/types_freebsd.go diff --git a/disk/disk_linux.go b/disk/disk_linux.go index ada9f9e76..e94d2124b 100644 --- a/disk/disk_linux.go +++ b/disk/disk_linux.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux -// +build linux package disk @@ -16,7 +16,7 @@ import ( "golang.org/x/sys/unix" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) const ( diff --git a/disk/disk_netbsd.go b/disk/disk_netbsd.go index 5976efadb..07b76fb89 100644 --- a/disk/disk_netbsd.go +++ b/disk/disk_netbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build netbsd -// +build netbsd package disk @@ -7,7 +7,7 @@ import ( "context" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "golang.org/x/sys/unix" ) diff --git a/disk/disk_netbsd_amd64.go b/disk/disk_netbsd_amd64.go index c21421cfe..c4b903f60 100644 --- a/disk/disk_netbsd_amd64.go +++ b/disk/disk_netbsd_amd64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build netbsd && amd64 -// +build netbsd,amd64 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs types_netbsd.go diff --git a/disk/disk_netbsd_arm64.go b/disk/disk_netbsd_arm64.go index dfe48f812..d01c864e7 100644 --- a/disk/disk_netbsd_arm64.go +++ b/disk/disk_netbsd_arm64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build netbsd && arm64 -// +build netbsd,arm64 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs types_netbsd.go diff --git a/disk/disk_openbsd.go b/disk/disk_openbsd.go index 81ff23994..713e38e1d 100644 --- a/disk/disk_openbsd.go +++ b/disk/disk_openbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd -// +build openbsd package disk @@ -8,7 +8,7 @@ import ( "context" "encoding/binary" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "golang.org/x/sys/unix" ) diff --git a/disk/disk_openbsd_386.go b/disk/disk_openbsd_386.go index f4c139f5e..919b8949b 100644 --- a/disk/disk_openbsd_386.go +++ b/disk/disk_openbsd_386.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && 386 -// +build openbsd,386 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs disk/types_openbsd.go diff --git a/disk/disk_openbsd_amd64.go b/disk/disk_openbsd_amd64.go index c1bd52ef8..ca8fb8222 100644 --- a/disk/disk_openbsd_amd64.go +++ b/disk/disk_openbsd_amd64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs types_openbsd.go diff --git a/disk/disk_openbsd_arm.go b/disk/disk_openbsd_arm.go index 86054a626..b9821d922 100644 --- a/disk/disk_openbsd_arm.go +++ b/disk/disk_openbsd_arm.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && arm -// +build openbsd,arm // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs disk/types_openbsd.go diff --git a/disk/disk_openbsd_arm64.go b/disk/disk_openbsd_arm64.go index ae1cf57e1..1cde02f25 100644 --- a/disk/disk_openbsd_arm64.go +++ b/disk/disk_openbsd_arm64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && arm64 -// +build openbsd,arm64 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs disk/types_openbsd.go diff --git a/disk/disk_openbsd_riscv64.go b/disk/disk_openbsd_riscv64.go index 8374b94eb..9129851d7 100644 --- a/disk/disk_openbsd_riscv64.go +++ b/disk/disk_openbsd_riscv64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && riscv64 -// +build openbsd,riscv64 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs disk/types_openbsd.go diff --git a/disk/disk_solaris.go b/disk/disk_solaris.go index 5d6ea8653..f849da96b 100644 --- a/disk/disk_solaris.go +++ b/disk/disk_solaris.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build solaris -// +build solaris package disk @@ -16,7 +16,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "golang.org/x/sys/unix" ) diff --git a/disk/disk_test.go b/disk/disk_test.go index 5adae5ca3..fea4d5203 100644 --- a/disk/disk_test.go +++ b/disk/disk_test.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package disk import ( @@ -7,7 +8,7 @@ import ( "sync" "testing" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func skipIfNotImplementedErr(t *testing.T, err error) { diff --git a/disk/disk_unix.go b/disk/disk_unix.go index 1e7352408..4ebf4c546 100644 --- a/disk/disk_unix.go +++ b/disk/disk_unix.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build freebsd || linux || darwin || (aix && !cgo) -// +build freebsd linux darwin aix,!cgo package disk diff --git a/disk/disk_windows.go b/disk/disk_windows.go index e17db3e5b..86d6a4e9d 100644 --- a/disk/disk_windows.go +++ b/disk/disk_windows.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build windows -// +build windows package disk @@ -10,7 +10,7 @@ import ( "syscall" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "golang.org/x/sys/windows" "golang.org/x/sys/windows/registry" ) diff --git a/disk/iostat_darwin.c b/disk/iostat_darwin.c index 8aab04f60..2fa33dd1e 100644 --- a/disk/iostat_darwin.c +++ b/disk/iostat_darwin.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// SPDX-FileCopyrightText: Copyright (c) 2017, kadota kyohei // https://github.com/lufia/iostat/blob/9f7362b77ad333b26c01c99de52a11bdb650ded2/iostat_darwin.c #include #include diff --git a/disk/iostat_darwin.h b/disk/iostat_darwin.h index cb9ec7a0a..65e26fae2 100644 --- a/disk/iostat_darwin.h +++ b/disk/iostat_darwin.h @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// SPDX-FileCopyrightText: Copyright (c) 2017, kadota kyohei // https://github.com/lufia/iostat/blob/9f7362b77ad333b26c01c99de52a11bdb650ded2/iostat_darwin.h typedef struct DriveStats DriveStats; typedef struct CPUStats CPUStats; diff --git a/disk/types_freebsd.go b/disk/types_freebsd.go index 47f55513a..6fc14fe7c 100644 --- a/disk/types_freebsd.go +++ b/disk/types_freebsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build ignore -// +build ignore // Hand writing: _Ctype_struct___0 diff --git a/disk/types_netbsd.go b/disk/types_netbsd.go index c0326f5c2..63a6aec90 100644 --- a/disk/types_netbsd.go +++ b/disk/types_netbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build ignore -// +build ignore // Hand writing: _Ctype_struct___0 diff --git a/disk/types_openbsd.go b/disk/types_openbsd.go index abb43c806..2329fb985 100644 --- a/disk/types_openbsd.go +++ b/disk/types_openbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build ignore -// +build ignore // Hand writing: _Ctype_struct___0 diff --git a/doc.go b/doc.go index 6a65fe268..fc471f694 100644 --- a/doc.go +++ b/doc.go @@ -1 +1,2 @@ +// SPDX-License-Identifier: BSD-3-Clause package gopsutil diff --git a/docker/docker.go b/docker/docker.go index dda7ba00a..1c0abca8a 100644 --- a/docker/docker.go +++ b/docker/docker.go @@ -1,11 +1,12 @@ +// SPDX-License-Identifier: BSD-3-Clause package docker import ( "encoding/json" "errors" - "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/internal/common" ) var ( diff --git a/docker/docker_linux.go b/docker/docker_linux.go index 4904874d0..f3409d953 100644 --- a/docker/docker_linux.go +++ b/docker/docker_linux.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux -// +build linux package docker @@ -13,8 +13,8 @@ import ( "strconv" "strings" - cpu "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/internal/common" + cpu "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/internal/common" ) // GetDockerStat returns a list of Docker basic stats. diff --git a/docker/docker_linux_test.go b/docker/docker_linux_test.go index 5ef80f932..2d0f35b03 100644 --- a/docker/docker_linux_test.go +++ b/docker/docker_linux_test.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux -// +build linux package docker diff --git a/docker/docker_notlinux.go b/docker/docker_notlinux.go index 434ca12aa..ca7a7f914 100644 --- a/docker/docker_notlinux.go +++ b/docker/docker_notlinux.go @@ -1,12 +1,12 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build !linux -// +build !linux package docker import ( "context" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) // GetDockerStat returns a list of Docker basic stats. diff --git a/docker/main_test.go b/docker/main_test.go index 1d6e6bfe0..14ee18689 100644 --- a/docker/main_test.go +++ b/docker/main_test.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package docker import ( diff --git a/go.mod b/go.mod index a529c598b..37788603d 100644 --- a/go.mod +++ b/go.mod @@ -13,4 +13,10 @@ require ( golang.org/x/sys v0.17.0 ) -retract v3.22.11 +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/go-ole/go-ole v1.2.6 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/go.sum b/go.sum index 390501b5e..9590ea4cb 100644 --- a/go.sum +++ b/go.sum @@ -1,10 +1,8 @@ -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= @@ -16,12 +14,6 @@ github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:Om github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= -github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= @@ -39,6 +31,5 @@ golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/host/host.go b/host/host.go index ee9486369..1e401a220 100644 --- a/host/host.go +++ b/host/host.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package host import ( @@ -8,7 +9,7 @@ import ( "runtime" "time" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) type Warnings = common.Warnings diff --git a/host/host_bsd.go b/host/host_bsd.go index f9a296148..b67f8fb6e 100644 --- a/host/host_bsd.go +++ b/host/host_bsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin || freebsd || openbsd || netbsd -// +build darwin freebsd openbsd netbsd package host diff --git a/host/host_darwin.go b/host/host_darwin.go index 873ed4aee..068f1060a 100644 --- a/host/host_darwin.go +++ b/host/host_darwin.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin -// +build darwin package host @@ -15,8 +15,8 @@ import ( "golang.org/x/sys/unix" - "github.com/shirou/gopsutil/v3/internal/common" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/internal/common" + "github.com/shirou/gopsutil/v4/process" ) // from utmpx.h diff --git a/host/host_darwin_amd64.go b/host/host_darwin_amd64.go index 8caeed2e8..1efc353aa 100644 --- a/host/host_darwin_amd64.go +++ b/host/host_darwin_amd64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_darwin.go diff --git a/host/host_darwin_arm64.go b/host/host_darwin_arm64.go index 293bd4df8..512e56970 100644 --- a/host/host_darwin_arm64.go +++ b/host/host_darwin_arm64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin && arm64 -// +build darwin,arm64 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs host/types_darwin.go diff --git a/host/host_darwin_cgo.go b/host/host_darwin_cgo.go index ffdc7b78f..93c613eb7 100644 --- a/host/host_darwin_cgo.go +++ b/host/host_darwin_cgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin && cgo -// +build darwin,cgo package host diff --git a/host/host_darwin_nocgo.go b/host/host_darwin_nocgo.go index 6285ba94d..d73a89334 100644 --- a/host/host_darwin_nocgo.go +++ b/host/host_darwin_nocgo.go @@ -1,12 +1,12 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin && !cgo -// +build darwin,!cgo package host import ( "context" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func SensorsTemperaturesWithContext(ctx context.Context) ([]TemperatureStat, error) { diff --git a/host/host_fallback.go b/host/host_fallback.go index a393ca15d..dcfc4bc07 100644 --- a/host/host_fallback.go +++ b/host/host_fallback.go @@ -1,12 +1,12 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build !darwin && !linux && !freebsd && !openbsd && !netbsd && !solaris && !windows -// +build !darwin,!linux,!freebsd,!openbsd,!netbsd,!solaris,!windows package host import ( "context" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func HostIDWithContext(ctx context.Context) (string, error) { diff --git a/host/host_freebsd.go b/host/host_freebsd.go index 9a5382d39..884e079df 100644 --- a/host/host_freebsd.go +++ b/host/host_freebsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build freebsd -// +build freebsd package host @@ -13,8 +13,8 @@ import ( "strings" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/internal/common" + "github.com/shirou/gopsutil/v4/process" "golang.org/x/sys/unix" ) diff --git a/host/host_freebsd_386.go b/host/host_freebsd_386.go index 88453d2a2..0d31eb113 100644 --- a/host/host_freebsd_386.go +++ b/host/host_freebsd_386.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs types_freebsd.go diff --git a/host/host_freebsd_amd64.go b/host/host_freebsd_amd64.go index 8af74b0fe..603a0ba50 100644 --- a/host/host_freebsd_amd64.go +++ b/host/host_freebsd_amd64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs types_freebsd.go diff --git a/host/host_freebsd_arm.go b/host/host_freebsd_arm.go index f7d6ede55..5021f5e1b 100644 --- a/host/host_freebsd_arm.go +++ b/host/host_freebsd_arm.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs types_freebsd.go diff --git a/host/host_freebsd_arm64.go b/host/host_freebsd_arm64.go index 41bec3c11..4fe188b33 100644 --- a/host/host_freebsd_arm64.go +++ b/host/host_freebsd_arm64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build freebsd && arm64 -// +build freebsd,arm64 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs host/types_freebsd.go diff --git a/host/host_linux.go b/host/host_linux.go index 5d4c1a90f..f8a4aa2bb 100644 --- a/host/host_linux.go +++ b/host/host_linux.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux -// +build linux package host @@ -17,7 +17,7 @@ import ( "golang.org/x/sys/unix" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) type lsbStruct struct { diff --git a/host/host_linux_386.go b/host/host_linux_386.go index 46e0c5d5a..3e241b104 100644 --- a/host/host_linux_386.go +++ b/host/host_linux_386.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // ATTENTION - FILE MANUAL FIXED AFTER CGO. // Fixed line: Tv _Ctype_struct_timeval -> Tv UtTv // Created by cgo -godefs, MANUAL FIXED diff --git a/host/host_linux_amd64.go b/host/host_linux_amd64.go index 1e574482f..480e72d3b 100644 --- a/host/host_linux_amd64.go +++ b/host/host_linux_amd64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_linux.go diff --git a/host/host_linux_arm.go b/host/host_linux_arm.go index 7abbbb8a3..1b7ee978a 100644 --- a/host/host_linux_arm.go +++ b/host/host_linux_arm.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_linux.go | sed "s/uint8/int8/g" diff --git a/host/host_linux_arm64.go b/host/host_linux_arm64.go index eebef55cd..73e52006a 100644 --- a/host/host_linux_arm64.go +++ b/host/host_linux_arm64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_linux.go diff --git a/host/host_linux_loong64.go b/host/host_linux_loong64.go index edf1be597..c4c8390f3 100644 --- a/host/host_linux_loong64.go +++ b/host/host_linux_loong64.go @@ -1,8 +1,8 @@ +// SPDX-License-Identifier: BSD-3-Clause // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs host/types_linux.go //go:build linux && loong64 -// +build linux,loong64 package host diff --git a/host/host_linux_mips.go b/host/host_linux_mips.go index 50207e5bc..8aa049cae 100644 --- a/host/host_linux_mips.go +++ b/host/host_linux_mips.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_linux.go diff --git a/host/host_linux_mips64.go b/host/host_linux_mips64.go index 50207e5bc..8aa049cae 100644 --- a/host/host_linux_mips64.go +++ b/host/host_linux_mips64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_linux.go diff --git a/host/host_linux_mips64le.go b/host/host_linux_mips64le.go index 50207e5bc..8aa049cae 100644 --- a/host/host_linux_mips64le.go +++ b/host/host_linux_mips64le.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_linux.go diff --git a/host/host_linux_mipsle.go b/host/host_linux_mipsle.go index 50207e5bc..8aa049cae 100644 --- a/host/host_linux_mipsle.go +++ b/host/host_linux_mipsle.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_linux.go diff --git a/host/host_linux_ppc64.go b/host/host_linux_ppc64.go index 5b324effa..23f5cb9d8 100644 --- a/host/host_linux_ppc64.go +++ b/host/host_linux_ppc64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux && ppc64 -// +build linux,ppc64 // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_linux.go diff --git a/host/host_linux_ppc64le.go b/host/host_linux_ppc64le.go index 51f5bee11..e81f12392 100644 --- a/host/host_linux_ppc64le.go +++ b/host/host_linux_ppc64le.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux && ppc64le -// +build linux,ppc64le // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_linux.go diff --git a/host/host_linux_riscv64.go b/host/host_linux_riscv64.go index bb03a0b39..080fdb8dc 100644 --- a/host/host_linux_riscv64.go +++ b/host/host_linux_riscv64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_linux.go diff --git a/host/host_linux_s390x.go b/host/host_linux_s390x.go index 6ea432a61..738af6018 100644 --- a/host/host_linux_s390x.go +++ b/host/host_linux_s390x.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux && s390x -// +build linux,s390x // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_linux.go diff --git a/host/host_linux_test.go b/host/host_linux_test.go index c114ec795..6fe4ee649 100644 --- a/host/host_linux_test.go +++ b/host/host_linux_test.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux -// +build linux package host @@ -7,7 +7,7 @@ import ( "context" "testing" - "github.com/shirou/gopsutil/v3/common" + "github.com/shirou/gopsutil/v4/common" ) func TestGetRedhatishVersion(t *testing.T) { diff --git a/host/host_netbsd.go b/host/host_netbsd.go index 488f1dfc2..5bc338ec6 100644 --- a/host/host_netbsd.go +++ b/host/host_netbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build netbsd -// +build netbsd package host @@ -7,7 +7,7 @@ import ( "context" "strings" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "golang.org/x/sys/unix" ) diff --git a/host/host_openbsd.go b/host/host_openbsd.go index 325015c23..47db4ff8d 100644 --- a/host/host_openbsd.go +++ b/host/host_openbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd -// +build openbsd package host @@ -12,8 +12,8 @@ import ( "strings" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/internal/common" + "github.com/shirou/gopsutil/v4/process" "golang.org/x/sys/unix" ) diff --git a/host/host_openbsd_386.go b/host/host_openbsd_386.go index b299d7ae4..df820a4ab 100644 --- a/host/host_openbsd_386.go +++ b/host/host_openbsd_386.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && 386 -// +build openbsd,386 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs host/types_openbsd.go diff --git a/host/host_openbsd_amd64.go b/host/host_openbsd_amd64.go index 2d23b9b71..b1d674e8c 100644 --- a/host/host_openbsd_amd64.go +++ b/host/host_openbsd_amd64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_openbsd.go diff --git a/host/host_openbsd_arm.go b/host/host_openbsd_arm.go index f0ac57d0b..e5f1590fe 100644 --- a/host/host_openbsd_arm.go +++ b/host/host_openbsd_arm.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && arm -// +build openbsd,arm // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs host/types_openbsd.go diff --git a/host/host_openbsd_arm64.go b/host/host_openbsd_arm64.go index 20fb42dd7..d8c1061f7 100644 --- a/host/host_openbsd_arm64.go +++ b/host/host_openbsd_arm64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && arm64 -// +build openbsd,arm64 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs host/types_openbsd.go diff --git a/host/host_openbsd_riscv64.go b/host/host_openbsd_riscv64.go index 7a123b649..584004b2f 100644 --- a/host/host_openbsd_riscv64.go +++ b/host/host_openbsd_riscv64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && riscv64 -// +build openbsd,riscv64 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs host/types_openbsd.go diff --git a/host/host_posix.go b/host/host_posix.go index e7e0d837f..91ab6aee8 100644 --- a/host/host_posix.go +++ b/host/host_posix.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux || freebsd || openbsd || netbsd || darwin || solaris -// +build linux freebsd openbsd netbsd darwin solaris package host diff --git a/host/host_solaris.go b/host/host_solaris.go index fef67f835..ae4e710a7 100644 --- a/host/host_solaris.go +++ b/host/host_solaris.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package host import ( @@ -12,7 +13,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func HostIDWithContext(ctx context.Context) (string, error) { diff --git a/host/host_test.go b/host/host_test.go index d3b75859e..5eda93896 100644 --- a/host/host_test.go +++ b/host/host_test.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package host import ( @@ -7,7 +8,7 @@ import ( "sync" "testing" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func skipIfNotImplementedErr(t *testing.T, err error) { diff --git a/host/host_windows.go b/host/host_windows.go index b83ad6db1..11783a641 100644 --- a/host/host_windows.go +++ b/host/host_windows.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build windows -// +build windows package host @@ -14,8 +14,8 @@ import ( "time" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/internal/common" + "github.com/shirou/gopsutil/v4/process" "github.com/yusufpapurcu/wmi" "golang.org/x/sys/windows" ) diff --git a/host/smc_darwin.c b/host/smc_darwin.c index 0197d95b4..f0c3f3a63 100644 --- a/host/smc_darwin.c +++ b/host/smc_darwin.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause #include #include #include "smc_darwin.h" diff --git a/host/smc_darwin.h b/host/smc_darwin.h index e3013abdb..74ae55af6 100644 --- a/host/smc_darwin.h +++ b/host/smc_darwin.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause #ifndef __SMC_H__ #define __SMC_H__ 1 diff --git a/host/types_darwin.go b/host/types_darwin.go index 3378cffe4..4e35ab72d 100644 --- a/host/types_darwin.go +++ b/host/types_darwin.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build ignore -// +build ignore // plus hand editing about timeval diff --git a/host/types_freebsd.go b/host/types_freebsd.go index 79154d7ec..50a62d44e 100644 --- a/host/types_freebsd.go +++ b/host/types_freebsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build ignore -// +build ignore /* Input to cgo -godefs. diff --git a/host/types_linux.go b/host/types_linux.go index 2b087b1a0..b225af166 100644 --- a/host/types_linux.go +++ b/host/types_linux.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build ignore -// +build ignore /* Input to cgo -godefs. diff --git a/host/types_openbsd.go b/host/types_openbsd.go index 81cdd5336..fe1e5b9a5 100644 --- a/host/types_openbsd.go +++ b/host/types_openbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build ignore -// +build ignore /* Input to cgo -godefs. diff --git a/internal/common/binary.go b/internal/common/binary.go index 5e8d43db8..6e75e74b0 100644 --- a/internal/common/binary.go +++ b/internal/common/binary.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package common // Copyright 2009 The Go Authors. All rights reserved. diff --git a/internal/common/common.go b/internal/common/common.go index 5e25e507b..642aabc55 100644 --- a/internal/common/common.go +++ b/internal/common/common.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package common // @@ -25,7 +26,7 @@ import ( "strings" "time" - "github.com/shirou/gopsutil/v3/common" + "github.com/shirou/gopsutil/v4/common" ) var ( diff --git a/internal/common/common_darwin.go b/internal/common/common_darwin.go index f1a784597..53f9ae8d9 100644 --- a/internal/common/common_darwin.go +++ b/internal/common/common_darwin.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin -// +build darwin package common diff --git a/internal/common/common_freebsd.go b/internal/common/common_freebsd.go index f590e2e67..53cdceeb6 100644 --- a/internal/common/common_freebsd.go +++ b/internal/common/common_freebsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build freebsd || openbsd -// +build freebsd openbsd package common diff --git a/internal/common/common_linux.go b/internal/common/common_linux.go index a429e16a2..85802dcb0 100644 --- a/internal/common/common_linux.go +++ b/internal/common/common_linux.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux -// +build linux package common diff --git a/internal/common/common_netbsd.go b/internal/common/common_netbsd.go index efbc710a5..206532126 100644 --- a/internal/common/common_netbsd.go +++ b/internal/common/common_netbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build netbsd -// +build netbsd package common diff --git a/internal/common/common_openbsd.go b/internal/common/common_openbsd.go index 58d76f334..00fa19a2f 100644 --- a/internal/common/common_openbsd.go +++ b/internal/common/common_openbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd -// +build openbsd package common diff --git a/internal/common/common_test.go b/internal/common/common_test.go index 424ea26ab..77db9b4ca 100644 --- a/internal/common/common_test.go +++ b/internal/common/common_test.go @@ -1,15 +1,15 @@ +// SPDX-License-Identifier: BSD-3-Clause package common import ( "context" - "fmt" "os" "reflect" "runtime" "strings" "testing" - "github.com/shirou/gopsutil/v3/common" + "github.com/shirou/gopsutil/v4/common" ) func TestReadlines(t *testing.T) { @@ -17,17 +17,16 @@ func TestReadlines(t *testing.T) { if err != nil { t.Error(err) } - if !strings.Contains(ret[0], "package common") { + if !strings.Contains(ret[1], "package common") { t.Error("could not read correctly") } } func TestReadLinesOffsetN(t *testing.T) { - ret, err := ReadLinesOffsetN("common_test.go", 2, 1) + ret, err := ReadLinesOffsetN("common_test.go", 3, 1) if err != nil { t.Error(err) } - fmt.Println(ret[0]) if !strings.Contains(ret[0], `import (`) { t.Error("could not read correctly") } diff --git a/internal/common/common_unix.go b/internal/common/common_unix.go index 4af7e5c2a..2715b890b 100644 --- a/internal/common/common_unix.go +++ b/internal/common/common_unix.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux || freebsd || darwin || openbsd -// +build linux freebsd darwin openbsd package common diff --git a/internal/common/common_windows.go b/internal/common/common_windows.go index 301b2315b..766ed2fcb 100644 --- a/internal/common/common_windows.go +++ b/internal/common/common_windows.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build windows -// +build windows package common diff --git a/internal/common/endian.go b/internal/common/endian.go index 147cfdc4b..113ff2e9f 100644 --- a/internal/common/endian.go +++ b/internal/common/endian.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package common import "unsafe" diff --git a/internal/common/sleep.go b/internal/common/sleep.go index 9bed2419e..8108a1cac 100644 --- a/internal/common/sleep.go +++ b/internal/common/sleep.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package common import ( diff --git a/internal/common/sleep_test.go b/internal/common/sleep_test.go index aadc7667c..d3205c225 100644 --- a/internal/common/sleep_test.go +++ b/internal/common/sleep_test.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package common_test import ( @@ -6,7 +7,7 @@ import ( "testing" "time" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func TestSleep(test *testing.T) { diff --git a/internal/common/warnings.go b/internal/common/warnings.go index a4aaadaf5..888cc57fa 100644 --- a/internal/common/warnings.go +++ b/internal/common/warnings.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package common import "fmt" diff --git a/load/load.go b/load/load.go index 0da50904e..ec48a07ca 100644 --- a/load/load.go +++ b/load/load.go @@ -1,9 +1,10 @@ +// SPDX-License-Identifier: BSD-3-Clause package load import ( "encoding/json" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) var invoke common.Invoker = common.Invoke{} diff --git a/load/load_aix.go b/load/load_aix.go index 78b391280..eb5b5b066 100644 --- a/load/load_aix.go +++ b/load/load_aix.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build aix -// +build aix package load diff --git a/load/load_aix_cgo.go b/load/load_aix_cgo.go index bbbf287e2..e325432ed 100644 --- a/load/load_aix_cgo.go +++ b/load/load_aix_cgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build aix && cgo -// +build aix,cgo package load diff --git a/load/load_aix_nocgo.go b/load/load_aix_nocgo.go index 25d50ac18..fed8fc21b 100644 --- a/load/load_aix_nocgo.go +++ b/load/load_aix_nocgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build aix && !cgo -// +build aix,!cgo package load @@ -9,7 +9,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) var separator = regexp.MustCompile(`,?\s+`) diff --git a/load/load_bsd.go b/load/load_bsd.go index 51d928682..97001f3c6 100644 --- a/load/load_bsd.go +++ b/load/load_bsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build freebsd || openbsd -// +build freebsd openbsd package load diff --git a/load/load_darwin.go b/load/load_darwin.go index ce8018813..fb7d5c09c 100644 --- a/load/load_darwin.go +++ b/load/load_darwin.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin -// +build darwin package load diff --git a/load/load_fallback.go b/load/load_fallback.go index 3e41fd1ea..e633066be 100644 --- a/load/load_fallback.go +++ b/load/load_fallback.go @@ -1,12 +1,12 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build !darwin && !linux && !freebsd && !openbsd && !windows && !solaris && !aix -// +build !darwin,!linux,!freebsd,!openbsd,!windows,!solaris,!aix package load import ( "context" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func Avg() (*AvgStat, error) { diff --git a/load/load_freebsd.go b/load/load_freebsd.go index 406980506..3e35f3f73 100644 --- a/load/load_freebsd.go +++ b/load/load_freebsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build freebsd -// +build freebsd package load diff --git a/load/load_linux.go b/load/load_linux.go index 06bceeb84..09c2b1653 100644 --- a/load/load_linux.go +++ b/load/load_linux.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux -// +build linux package load @@ -10,7 +10,7 @@ import ( "strings" "syscall" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func Avg() (*AvgStat, error) { diff --git a/load/load_openbsd.go b/load/load_openbsd.go index 1d5d611f3..df00588cd 100644 --- a/load/load_openbsd.go +++ b/load/load_openbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd -// +build openbsd package load diff --git a/load/load_solaris.go b/load/load_solaris.go index 99b339bd8..3713f4a80 100644 --- a/load/load_solaris.go +++ b/load/load_solaris.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build solaris -// +build solaris package load diff --git a/load/load_test.go b/load/load_test.go index 1790fa559..f75caa42c 100644 --- a/load/load_test.go +++ b/load/load_test.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package load import ( @@ -5,7 +6,7 @@ import ( "fmt" "testing" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func skipIfNotImplementedErr(t testing.TB, err error) { diff --git a/load/load_windows.go b/load/load_windows.go index 5241dfaab..a55c7b40a 100644 --- a/load/load_windows.go +++ b/load/load_windows.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build windows -// +build windows package load @@ -9,7 +9,7 @@ import ( "sync" "time" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) var ( diff --git a/mem/mem.go b/mem/mem.go index edaf268bb..0da71a988 100644 --- a/mem/mem.go +++ b/mem/mem.go @@ -1,9 +1,10 @@ +// SPDX-License-Identifier: BSD-3-Clause package mem import ( "encoding/json" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) var invoke common.Invoker = common.Invoke{} diff --git a/mem/mem_aix.go b/mem/mem_aix.go index 22a6a4e92..916bff30d 100644 --- a/mem/mem_aix.go +++ b/mem/mem_aix.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build aix -// +build aix package mem diff --git a/mem/mem_aix_cgo.go b/mem/mem_aix_cgo.go index 67e11dff8..2d03dd0c3 100644 --- a/mem/mem_aix_cgo.go +++ b/mem/mem_aix_cgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build aix && cgo -// +build aix,cgo package mem diff --git a/mem/mem_aix_nocgo.go b/mem/mem_aix_nocgo.go index cc6a76d2f..cfcc4f90f 100644 --- a/mem/mem_aix_nocgo.go +++ b/mem/mem_aix_nocgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build aix && !cgo -// +build aix,!cgo package mem @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func VirtualMemoryWithContext(ctx context.Context) (*VirtualMemoryStat, error) { diff --git a/mem/mem_bsd.go b/mem/mem_bsd.go index ef867d742..4f3e57c03 100644 --- a/mem/mem_bsd.go +++ b/mem/mem_bsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build freebsd || openbsd || netbsd -// +build freebsd openbsd netbsd package mem diff --git a/mem/mem_bsd_test.go b/mem/mem_bsd_test.go index 9839a0435..8b0eb9f06 100644 --- a/mem/mem_bsd_test.go +++ b/mem/mem_bsd_test.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build freebsd || openbsd -// +build freebsd openbsd package mem diff --git a/mem/mem_darwin.go b/mem/mem_darwin.go index a05a0faba..a33c5f125 100644 --- a/mem/mem_darwin.go +++ b/mem/mem_darwin.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin -// +build darwin package mem @@ -10,7 +10,7 @@ import ( "golang.org/x/sys/unix" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func getHwMemsize() (uint64, error) { diff --git a/mem/mem_darwin_cgo.go b/mem/mem_darwin_cgo.go index e5da7dcdb..cc6657d04 100644 --- a/mem/mem_darwin_cgo.go +++ b/mem/mem_darwin_cgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin && cgo -// +build darwin,cgo package mem diff --git a/mem/mem_darwin_nocgo.go b/mem/mem_darwin_nocgo.go index c93931680..097a93e63 100644 --- a/mem/mem_darwin_nocgo.go +++ b/mem/mem_darwin_nocgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin && !cgo -// +build darwin,!cgo package mem diff --git a/mem/mem_darwin_test.go b/mem/mem_darwin_test.go index 4e0d9a014..c7f5668bd 100644 --- a/mem/mem_darwin_test.go +++ b/mem/mem_darwin_test.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin -// +build darwin package mem diff --git a/mem/mem_fallback.go b/mem/mem_fallback.go index 697fd8709..ba882c8be 100644 --- a/mem/mem_fallback.go +++ b/mem/mem_fallback.go @@ -1,12 +1,12 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build !darwin && !linux && !freebsd && !openbsd && !solaris && !windows && !plan9 && !aix && !netbsd -// +build !darwin,!linux,!freebsd,!openbsd,!solaris,!windows,!plan9,!aix,!netbsd package mem import ( "context" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func VirtualMemory() (*VirtualMemoryStat, error) { diff --git a/mem/mem_freebsd.go b/mem/mem_freebsd.go index 9a56785b3..d9cae7116 100644 --- a/mem/mem_freebsd.go +++ b/mem/mem_freebsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build freebsd -// +build freebsd package mem @@ -8,7 +8,7 @@ import ( "errors" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "golang.org/x/sys/unix" ) diff --git a/mem/mem_linux.go b/mem/mem_linux.go index 214a91e47..9ed79016e 100644 --- a/mem/mem_linux.go +++ b/mem/mem_linux.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux -// +build linux package mem @@ -16,7 +16,7 @@ import ( "golang.org/x/sys/unix" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) type VirtualMemoryExStat struct { diff --git a/mem/mem_linux_test.go b/mem/mem_linux_test.go index 6b6fb782a..0aef8bd36 100644 --- a/mem/mem_linux_test.go +++ b/mem/mem_linux_test.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux -// +build linux package mem diff --git a/mem/mem_netbsd.go b/mem/mem_netbsd.go index d1f54ecaf..0a41b3e34 100644 --- a/mem/mem_netbsd.go +++ b/mem/mem_netbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build netbsd -// +build netbsd package mem diff --git a/mem/mem_openbsd.go b/mem/mem_openbsd.go index e37d5abe0..2510bb0d3 100644 --- a/mem/mem_openbsd.go +++ b/mem/mem_openbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd -// +build openbsd package mem @@ -10,7 +10,7 @@ import ( "errors" "fmt" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "golang.org/x/sys/unix" ) diff --git a/mem/mem_openbsd_386.go b/mem/mem_openbsd_386.go index de2b26ca4..552e93f4a 100644 --- a/mem/mem_openbsd_386.go +++ b/mem/mem_openbsd_386.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && 386 -// +build openbsd,386 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs mem/types_openbsd.go diff --git a/mem/mem_openbsd_amd64.go b/mem/mem_openbsd_amd64.go index d187abf01..73e5b72aa 100644 --- a/mem/mem_openbsd_amd64.go +++ b/mem/mem_openbsd_amd64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_openbsd.go diff --git a/mem/mem_openbsd_arm.go b/mem/mem_openbsd_arm.go index 2488f1851..57b5861de 100644 --- a/mem/mem_openbsd_arm.go +++ b/mem/mem_openbsd_arm.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && arm -// +build openbsd,arm // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs mem/types_openbsd.go diff --git a/mem/mem_openbsd_arm64.go b/mem/mem_openbsd_arm64.go index 3661b16fb..f39a6456b 100644 --- a/mem/mem_openbsd_arm64.go +++ b/mem/mem_openbsd_arm64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && arm64 -// +build openbsd,arm64 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs mem/types_openbsd.go diff --git a/mem/mem_openbsd_riscv64.go b/mem/mem_openbsd_riscv64.go index 7a7b48038..f9f838f54 100644 --- a/mem/mem_openbsd_riscv64.go +++ b/mem/mem_openbsd_riscv64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && riscv64 -// +build openbsd,riscv64 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs mem/types_openbsd.go diff --git a/mem/mem_plan9.go b/mem/mem_plan9.go index b5259f844..c17a102ee 100644 --- a/mem/mem_plan9.go +++ b/mem/mem_plan9.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build plan9 -// +build plan9 package mem @@ -8,7 +8,7 @@ import ( "os" stats "github.com/lufia/plan9stats" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func SwapMemory() (*SwapMemoryStat, error) { diff --git a/mem/mem_plan9_test.go b/mem/mem_plan9_test.go index 1ae353d3a..836d6c8fa 100644 --- a/mem/mem_plan9_test.go +++ b/mem/mem_plan9_test.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build plan9 -// +build plan9 package mem diff --git a/mem/mem_solaris.go b/mem/mem_solaris.go index c911267e1..06d0d9a00 100644 --- a/mem/mem_solaris.go +++ b/mem/mem_solaris.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build solaris -// +build solaris package mem @@ -11,7 +11,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "github.com/tklauser/go-sysconf" ) diff --git a/mem/mem_solaris_test.go b/mem/mem_solaris_test.go index 05360203a..5e0aa700f 100644 --- a/mem/mem_solaris_test.go +++ b/mem/mem_solaris_test.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build solaris -// +build solaris package mem diff --git a/mem/mem_test.go b/mem/mem_test.go index 79ddb0fc6..2dba7eca3 100644 --- a/mem/mem_test.go +++ b/mem/mem_test.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package mem import ( @@ -8,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func skipIfNotImplementedErr(t *testing.T, err error) { diff --git a/mem/mem_windows.go b/mem/mem_windows.go index 8c7fb1a13..4666cbd01 100644 --- a/mem/mem_windows.go +++ b/mem/mem_windows.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build windows -// +build windows package mem @@ -9,7 +9,7 @@ import ( "syscall" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "golang.org/x/sys/windows" ) diff --git a/mem/types_openbsd.go b/mem/types_openbsd.go index 8e0e412af..f71a457e4 100644 --- a/mem/types_openbsd.go +++ b/mem/types_openbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build ignore -// +build ignore /* Input to cgo -godefs. diff --git a/mktypes.sh b/mktypes.sh index 3b722f9a7..264ba1939 100644 --- a/mktypes.sh +++ b/mktypes.sh @@ -6,7 +6,7 @@ GOOS=$(go env GOOS) GOARCH=$(go env GOARCH) GOARCH=$(go env GOARCH) -for DIR in . v3 +for DIR in . do (cd "$DIR" || exit for PKG in $PKGS diff --git a/net/net.go b/net/net.go index 0f3a62f39..3890eda53 100644 --- a/net/net.go +++ b/net/net.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package net import ( @@ -5,7 +6,7 @@ import ( "encoding/json" "net" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) var invoke common.Invoker = common.Invoke{} diff --git a/net/net_aix.go b/net/net_aix.go index 81feaa8d7..df59abecb 100644 --- a/net/net_aix.go +++ b/net/net_aix.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build aix -// +build aix package net @@ -11,7 +11,7 @@ import ( "strings" "syscall" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func IOCounters(pernic bool) ([]IOCountersStat, error) { diff --git a/net/net_aix_cgo.go b/net/net_aix_cgo.go index 8c34f881c..a45a5b75c 100644 --- a/net/net_aix_cgo.go +++ b/net/net_aix_cgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build aix && cgo -// +build aix,cgo package net diff --git a/net/net_aix_nocgo.go b/net/net_aix_nocgo.go index e3fce9021..f63a21e73 100644 --- a/net/net_aix_nocgo.go +++ b/net/net_aix_nocgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build aix && !cgo -// +build aix,!cgo package net @@ -9,7 +9,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func parseNetstatI(output string) ([]IOCountersStat, error) { diff --git a/net/net_darwin.go b/net/net_darwin.go index 8a7b63744..f86b7bf9e 100644 --- a/net/net_darwin.go +++ b/net/net_darwin.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin -// +build darwin package net @@ -12,7 +12,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) var ( diff --git a/net/net_darwin_test.go b/net/net_darwin_test.go index 0680d08ad..86ed1262d 100644 --- a/net/net_darwin_test.go +++ b/net/net_darwin_test.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package net import ( diff --git a/net/net_fallback.go b/net/net_fallback.go index e136be1ba..e62deeeed 100644 --- a/net/net_fallback.go +++ b/net/net_fallback.go @@ -1,12 +1,12 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build !aix && !darwin && !linux && !freebsd && !openbsd && !windows && !solaris -// +build !aix,!darwin,!linux,!freebsd,!openbsd,!windows,!solaris package net import ( "context" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func IOCounters(pernic bool) ([]IOCountersStat, error) { diff --git a/net/net_freebsd.go b/net/net_freebsd.go index bf8baf094..155a49c40 100644 --- a/net/net_freebsd.go +++ b/net/net_freebsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build freebsd -// +build freebsd package net @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func IOCounters(pernic bool) ([]IOCountersStat, error) { diff --git a/net/net_linux.go b/net/net_linux.go index 6e8ce67fb..93cb03775 100644 --- a/net/net_linux.go +++ b/net/net_linux.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux -// +build linux package net @@ -16,7 +16,7 @@ import ( "strings" "syscall" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) const ( // Conntrack Column numbers diff --git a/net/net_linux_111.go b/net/net_linux_111.go index bd5c95871..c173944ac 100644 --- a/net/net_linux_111.go +++ b/net/net_linux_111.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build !go1.16 -// +build !go1.16 package net diff --git a/net/net_linux_116.go b/net/net_linux_116.go index a45072e92..f7a368799 100644 --- a/net/net_linux_116.go +++ b/net/net_linux_116.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build go1.16 -// +build go1.16 package net diff --git a/net/net_linux_netlink_test.go b/net/net_linux_netlink_test.go index 889719676..2d01a1a46 100644 --- a/net/net_linux_netlink_test.go +++ b/net/net_linux_netlink_test.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux -// +build linux package net diff --git a/net/net_linux_test.go b/net/net_linux_test.go index eae0e71b9..b7ccaa895 100644 --- a/net/net_linux_test.go +++ b/net/net_linux_test.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package net import ( @@ -11,7 +12,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func TestIOCountersByFileParsing(t *testing.T) { diff --git a/net/net_openbsd.go b/net/net_openbsd.go index cf48f53e7..c6b7deb80 100644 --- a/net/net_openbsd.go +++ b/net/net_openbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd -// +build openbsd package net @@ -12,7 +12,7 @@ import ( "strings" "syscall" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) var portMatch = regexp.MustCompile(`(.*)\.(\d+)$`) diff --git a/net/net_solaris.go b/net/net_solaris.go index 79d8ac30e..b886066e8 100644 --- a/net/net_solaris.go +++ b/net/net_solaris.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build solaris -// +build solaris package net @@ -11,7 +11,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) // NetIOCounters returnes network I/O statistics for every network diff --git a/net/net_test.go b/net/net_test.go index 72f4db9c5..43a487815 100644 --- a/net/net_test.go +++ b/net/net_test.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package net import ( @@ -7,7 +8,7 @@ import ( "runtime" "testing" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func skipIfNotImplementedErr(t *testing.T, err error) { diff --git a/net/net_unix.go b/net/net_unix.go index cb846e28a..71fc3b972 100644 --- a/net/net_unix.go +++ b/net/net_unix.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build freebsd || darwin -// +build freebsd darwin package net @@ -11,7 +11,7 @@ import ( "strings" "syscall" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) // Return a list of network connections opened. diff --git a/net/net_windows.go b/net/net_windows.go index 5d384342f..12f62cda0 100644 --- a/net/net_windows.go +++ b/net/net_windows.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build windows -// +build windows package net @@ -11,7 +11,7 @@ import ( "syscall" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "golang.org/x/sys/windows" ) diff --git a/net/types_darwin.go b/net/types_darwin.go index 81aca0119..c713f6b1b 100644 --- a/net/types_darwin.go +++ b/net/types_darwin.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build ignore -// +build ignore // Hand writing: _Ctype_struct___3, 4 diff --git a/process/process.go b/process/process.go index 1bb27abf8..669d8407f 100644 --- a/process/process.go +++ b/process/process.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package process import ( @@ -9,10 +10,10 @@ import ( "sync" "time" - "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/internal/common" - "github.com/shirou/gopsutil/v3/mem" - "github.com/shirou/gopsutil/v3/net" + "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/internal/common" + "github.com/shirou/gopsutil/v4/mem" + "github.com/shirou/gopsutil/v4/net" ) var ( diff --git a/process/process_bsd.go b/process/process_bsd.go index 263829ffa..dcc056101 100644 --- a/process/process_bsd.go +++ b/process/process_bsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin || freebsd || openbsd -// +build darwin freebsd openbsd package process @@ -8,8 +8,8 @@ import ( "context" "encoding/binary" - "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/internal/common" ) type MemoryInfoExStat struct{} diff --git a/process/process_darwin.go b/process/process_darwin.go index 176661cbd..181a402b9 100644 --- a/process/process_darwin.go +++ b/process/process_darwin.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin -// +build darwin package process @@ -13,8 +13,8 @@ import ( "github.com/tklauser/go-sysconf" "golang.org/x/sys/unix" - "github.com/shirou/gopsutil/v3/internal/common" - "github.com/shirou/gopsutil/v3/net" + "github.com/shirou/gopsutil/v4/internal/common" + "github.com/shirou/gopsutil/v4/net" ) // copied from sys/sysctl.h diff --git a/process/process_darwin_amd64.go b/process/process_darwin_amd64.go index b353e5eac..a13522473 100644 --- a/process/process_darwin_amd64.go +++ b/process/process_darwin_amd64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_darwin.go diff --git a/process/process_darwin_arm64.go b/process/process_darwin_arm64.go index cbd6bdc79..f1f3df365 100644 --- a/process/process_darwin_arm64.go +++ b/process/process_darwin_arm64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin && arm64 -// +build darwin,arm64 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs process/types_darwin.go diff --git a/process/process_darwin_cgo.go b/process/process_darwin_cgo.go index 858f08e7a..bbdfc963e 100644 --- a/process/process_darwin_cgo.go +++ b/process/process_darwin_cgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin && cgo -// +build darwin,cgo package process @@ -20,7 +20,7 @@ import ( "syscall" "unsafe" - "github.com/shirou/gopsutil/v3/cpu" + "github.com/shirou/gopsutil/v4/cpu" ) var ( diff --git a/process/process_darwin_nocgo.go b/process/process_darwin_nocgo.go index bc1d357df..090e21e0c 100644 --- a/process/process_darwin_nocgo.go +++ b/process/process_darwin_nocgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin && !cgo -// +build darwin,!cgo package process @@ -9,8 +9,8 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/internal/common" ) func (p *Process) CwdWithContext(ctx context.Context) (string, error) { diff --git a/process/process_fallback.go b/process/process_fallback.go index 1a5d0c4b4..78681bec4 100644 --- a/process/process_fallback.go +++ b/process/process_fallback.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build !darwin && !linux && !freebsd && !openbsd && !windows && !solaris && !plan9 -// +build !darwin,!linux,!freebsd,!openbsd,!windows,!solaris,!plan9 package process @@ -7,9 +7,9 @@ import ( "context" "syscall" - "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/internal/common" - "github.com/shirou/gopsutil/v3/net" + "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/internal/common" + "github.com/shirou/gopsutil/v4/net" ) type Signal = syscall.Signal diff --git a/process/process_freebsd.go b/process/process_freebsd.go index 40b10e14f..62841fd29 100644 --- a/process/process_freebsd.go +++ b/process/process_freebsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build freebsd -// +build freebsd package process @@ -10,9 +10,9 @@ import ( "strconv" "strings" - cpu "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/internal/common" - net "github.com/shirou/gopsutil/v3/net" + cpu "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/internal/common" + net "github.com/shirou/gopsutil/v4/net" "golang.org/x/sys/unix" ) diff --git a/process/process_freebsd_386.go b/process/process_freebsd_386.go index 08ab333b4..279ba9fbb 100644 --- a/process/process_freebsd_386.go +++ b/process/process_freebsd_386.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_freebsd.go diff --git a/process/process_freebsd_amd64.go b/process/process_freebsd_amd64.go index 560e627d2..f3b70ec1b 100644 --- a/process/process_freebsd_amd64.go +++ b/process/process_freebsd_amd64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_freebsd.go diff --git a/process/process_freebsd_arm.go b/process/process_freebsd_arm.go index 81ae0b9a8..75ed30630 100644 --- a/process/process_freebsd_arm.go +++ b/process/process_freebsd_arm.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_freebsd.go diff --git a/process/process_freebsd_arm64.go b/process/process_freebsd_arm64.go index effd470a0..dbb3baa3e 100644 --- a/process/process_freebsd_arm64.go +++ b/process/process_freebsd_arm64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build freebsd && arm64 -// +build freebsd,arm64 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs process/types_freebsd.go diff --git a/process/process_linux.go b/process/process_linux.go index 557435b34..8a6f5f53c 100644 --- a/process/process_linux.go +++ b/process/process_linux.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux -// +build linux package process @@ -18,9 +18,9 @@ import ( "github.com/tklauser/go-sysconf" "golang.org/x/sys/unix" - "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/internal/common" - "github.com/shirou/gopsutil/v3/net" + "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/internal/common" + "github.com/shirou/gopsutil/v4/net" ) var pageSize = uint64(os.Getpagesize()) diff --git a/process/process_linux_test.go b/process/process_linux_test.go index 87df81231..0adaddcdd 100644 --- a/process/process_linux_test.go +++ b/process/process_linux_test.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux -// +build linux package process diff --git a/process/process_openbsd.go b/process/process_openbsd.go index a58c5eb11..5e233034b 100644 --- a/process/process_openbsd.go +++ b/process/process_openbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd -// +build openbsd package process @@ -14,10 +14,10 @@ import ( "strings" "unsafe" - cpu "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/internal/common" - mem "github.com/shirou/gopsutil/v3/mem" - net "github.com/shirou/gopsutil/v3/net" + cpu "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/internal/common" + mem "github.com/shirou/gopsutil/v4/mem" + net "github.com/shirou/gopsutil/v4/net" "golang.org/x/sys/unix" ) diff --git a/process/process_openbsd_386.go b/process/process_openbsd_386.go index f4ed02491..e3c5c2b5a 100644 --- a/process/process_openbsd_386.go +++ b/process/process_openbsd_386.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && 386 -// +build openbsd,386 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs process/types_openbsd.go diff --git a/process/process_openbsd_amd64.go b/process/process_openbsd_amd64.go index 8607422b5..beb7c9b0b 100644 --- a/process/process_openbsd_amd64.go +++ b/process/process_openbsd_amd64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_openbsd.go diff --git a/process/process_openbsd_arm.go b/process/process_openbsd_arm.go index b94429f2e..ff082f43f 100644 --- a/process/process_openbsd_arm.go +++ b/process/process_openbsd_arm.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && arm -// +build openbsd,arm // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs process/types_openbsd.go diff --git a/process/process_openbsd_arm64.go b/process/process_openbsd_arm64.go index a3291b8ca..e180ba359 100644 --- a/process/process_openbsd_arm64.go +++ b/process/process_openbsd_arm64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && arm64 -// +build openbsd,arm64 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs process/types_openbsd.go diff --git a/process/process_openbsd_riscv64.go b/process/process_openbsd_riscv64.go index 076f095ea..c53924b6f 100644 --- a/process/process_openbsd_riscv64.go +++ b/process/process_openbsd_riscv64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && riscv64 -// +build openbsd,riscv64 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs process/types_openbsd.go diff --git a/process/process_plan9.go b/process/process_plan9.go index bc4bc062a..9d059d297 100644 --- a/process/process_plan9.go +++ b/process/process_plan9.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build plan9 -// +build plan9 package process @@ -7,9 +7,9 @@ import ( "context" "syscall" - "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/internal/common" - "github.com/shirou/gopsutil/v3/net" + "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/internal/common" + "github.com/shirou/gopsutil/v4/net" ) type Signal = syscall.Note diff --git a/process/process_posix.go b/process/process_posix.go index a01f9ecfc..caa9d3f7c 100644 --- a/process/process_posix.go +++ b/process/process_posix.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux || freebsd || openbsd || darwin || solaris -// +build linux freebsd openbsd darwin solaris package process @@ -16,7 +16,7 @@ import ( "golang.org/x/sys/unix" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) type Signal = syscall.Signal diff --git a/process/process_posix_test.go b/process/process_posix_test.go index 201a58c90..2b1140493 100644 --- a/process/process_posix_test.go +++ b/process/process_posix_test.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux || freebsd -// +build linux freebsd package process diff --git a/process/process_race_test.go b/process/process_race_test.go index 93c078d50..a91c4060a 100644 --- a/process/process_race_test.go +++ b/process/process_race_test.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build race -// +build race package process diff --git a/process/process_solaris.go b/process/process_solaris.go index dd4bd4760..5733b745e 100644 --- a/process/process_solaris.go +++ b/process/process_solaris.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package process import ( @@ -7,9 +8,9 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/internal/common" - "github.com/shirou/gopsutil/v3/net" + "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/internal/common" + "github.com/shirou/gopsutil/v4/net" ) type MemoryMapsStat struct { diff --git a/process/process_test.go b/process/process_test.go index 877992b25..100fcffd4 100644 --- a/process/process_test.go +++ b/process/process_test.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package process import ( @@ -21,7 +22,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) var mu sync.Mutex diff --git a/process/process_windows.go b/process/process_windows.go index f2053d985..a78afb7df 100644 --- a/process/process_windows.go +++ b/process/process_windows.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build windows -// +build windows package process @@ -18,9 +18,9 @@ import ( "unicode/utf16" "unsafe" - "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/internal/common" - "github.com/shirou/gopsutil/v3/net" + "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/internal/common" + "github.com/shirou/gopsutil/v4/net" "golang.org/x/sys/windows" ) diff --git a/process/process_windows_32bit.go b/process/process_windows_32bit.go index db4d45334..2b231c79d 100644 --- a/process/process_windows_32bit.go +++ b/process/process_windows_32bit.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build (windows && 386) || (windows && arm) -// +build windows,386 windows,arm package process @@ -8,7 +8,7 @@ import ( "syscall" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "golang.org/x/sys/windows" ) diff --git a/process/process_windows_64bit.go b/process/process_windows_64bit.go index 74c6212cf..befe52139 100644 --- a/process/process_windows_64bit.go +++ b/process/process_windows_64bit.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build (windows && amd64) || (windows && arm64) -// +build windows,amd64 windows,arm64 package process @@ -7,7 +7,7 @@ import ( "syscall" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "golang.org/x/sys/windows" ) diff --git a/process/types_darwin.go b/process/types_darwin.go index 3cde887d3..7dc9351dd 100644 --- a/process/types_darwin.go +++ b/process/types_darwin.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. @@ -6,7 +7,6 @@ // - all pointer in ExternProc to uint64 //go:build ignore -// +build ignore /* Input to cgo -godefs. diff --git a/process/types_freebsd.go b/process/types_freebsd.go index 658d46166..20eb40c41 100644 --- a/process/types_freebsd.go +++ b/process/types_freebsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build ignore -// +build ignore // We still need editing by hands. // go tool cgo -godefs types_freebsd.go | sed 's/\*int64/int64/' | sed 's/\*byte/int64/' > process_freebsd_amd64.go diff --git a/process/types_openbsd.go b/process/types_openbsd.go index 75f2344a9..c982d850b 100644 --- a/process/types_openbsd.go +++ b/process/types_openbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build ignore -// +build ignore // We still need editing by hands. // go tool cgo -godefs types_openbsd.go | sed 's/\*int64/int64/' | sed 's/\*byte/int64/' > process_openbsd_amd64.go diff --git a/winservices/manager.go b/winservices/manager.go index c9957f729..07a56af1a 100644 --- a/winservices/manager.go +++ b/winservices/manager.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build windows -// +build windows package winservices diff --git a/winservices/winservices.go b/winservices/winservices.go index 93ec0e104..0c85a0179 100644 --- a/winservices/winservices.go +++ b/winservices/winservices.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build windows -// +build windows package winservices