diff --git a/README.md b/README.md index fabd59e3..924f3289 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,7 +128,7 @@ 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 diff --git a/common/env.go b/common/env.go index 4b5f4980..4acad1fd 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 83bc23d4..56f53c3a 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 1439d1d7..bc766bd4 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 9c1e70b1..559dc5fe 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 f3a3186a..329ef833 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 41f395e5..79a458b8 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 1d5f0772..3a02024c 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 e067e99f..1af8566a 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 a9586236..44171be3 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 fef53e5d..19b1e9dd 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 57e14528..25ececa6 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 089f603c..245c1ec9 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 d3f47353..c68d6bff 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 8b7f4c32..e4799bcf 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 57e14528..25ececa6 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 8b7f4c32..e4799bcf 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 57e14528..25ececa6 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 27a709d3..33334f87 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 da467e2d..f78c61a2 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 e06f3052..644d25f5 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 1f66be34..2cda5cd2 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 57e14528..25ececa6 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 57e14528..25ececa6 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 fe332903..33233d3c 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 5e878399..40a6f43e 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 d659058c..464156d5 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 5e878399..40a6f43e 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 d659058c..464156d5 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 d659058c..464156d5 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 a2e99d8c..bff2e0c7 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 2820a3f4..9413e2ae 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 4231ad16..d8ba1d32 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 dd9362c3..527d9854 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 688660a1..4e9f964d 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 e10612fd..c9136b75 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 0d4b2534..310ea04f 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 ac8d0912..3fe7fae3 100644 --- a/disk/disk_aix.go +++ b/disk/disk_aix.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build aix -// +build aix package disk @@ -8,7 +8,7 @@ import ( "errors" "strings" - "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 aa534df3..a0d0829f 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 fcb11617..0b9aba79 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 @@ -9,7 +9,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_darwin.go b/disk/disk_darwin.go index 9362d9e5..6ed7400e 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 27c24c92..c5fcc06d 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 1f099b7c..8d55ca31 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 36525f69..17f0f7bf 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 9b53106c..10006feb 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 7fa1783d..4660b145 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 d86a308b..3f436317 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 7fa1783d..4660b145 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 f6b3f80d..15fae419 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 ada9f9e7..e94d2124 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 d313737e..b376f876 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 c21421cf..c4b903f6 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 dfe48f81..d01c864e 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 81ff2399..713e38e1 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 f4c139f5..919b8949 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 c1bd52ef..ca8fb822 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 86054a62..b9821d92 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 ae1cf57e..1cde02f2 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 8374b94e..9129851d 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 5d6ea865..f849da96 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 5adae5ca..fea4d520 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 4cef8cba..d69d8381 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 -// +build freebsd linux darwin package disk diff --git a/disk/disk_windows.go b/disk/disk_windows.go index e17db3e5..86d6a4e9 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 8aab04f6..2fa33dd1 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 cb9ec7a0..65e26fae 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 47f55513..6fc14fe7 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 c0326f5c..63a6aec9 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 abb43c80..2329fb98 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 6a65fe26..fc471f69 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 dda7ba00..1c0abca8 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 4904874d..f3409d95 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 5ef80f93..2d0f35b0 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 434ca12a..ca7a7f91 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 1d6e6bfe..14ee1868 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 5baf5a70..c5ed8bdc 100644 --- a/go.mod +++ b/go.mod @@ -21,4 +21,10 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect ) -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/host/host.go b/host/host.go index ee948636..1e401a22 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 f9a29614..b67f8fb6 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 873ed4ae..068f1060 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 8caeed2e..1efc353a 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 293bd4df..512e5697 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 ffdc7b78..93c613eb 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 6285ba94..d73a8933 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 150ccf00..b7a7d13a 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 && !aix -// +build !darwin,!linux,!freebsd,!openbsd,!netbsd,!solaris,!windows,!aix 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 9a5382d3..884e079d 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 88453d2a..0d31eb11 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 8af74b0f..603a0ba5 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 f7d6ede5..5021f5e1 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 41bec3c1..4fe188b3 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 5d4c1a90..f8a4aa2b 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 46e0c5d5..3e241b10 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 1e574482..480e72d3 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 7abbbb8a..1b7ee978 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 cd0b4ddc..0e6fc8b7 100644 --- a/host/host_linux_arm64.go +++ b/host/host_linux_arm64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs types_linux.go package host diff --git a/host/host_linux_loong64.go b/host/host_linux_loong64.go index edf1be59..c4c8390f 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 50207e5b..8aa049ca 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 50207e5b..8aa049ca 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 50207e5b..8aa049ca 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 50207e5b..8aa049ca 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 5b324eff..23f5cb9d 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 51f5bee1..e81f1239 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 bb03a0b3..080fdb8d 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 6ea432a6..738af601 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 c114ec79..6fe4ee64 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 488f1dfc..5bc338ec 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 325015c2..47db4ff8 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 b299d7ae..df820a4a 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 2d23b9b7..b1d674e8 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 f0ac57d0..e5f1590f 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 20fb42dd..d8c1061f 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 7a123b64..584004b2 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 e7e0d837..91ab6aee 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 fef67f83..ae4e710a 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 d3b75859..5eda9389 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 b83ad6db..11783a64 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 0197d95b..f0c3f3a6 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 e3013abd..74ae55af 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 3378cffe..4e35ab72 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 79154d7e..50a62d44 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 2b087b1a..b225af16 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 81cdd533..fe1e5b9a 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 5e8d43db..6e75e74b 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 5e25e507..642aabc5 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 f1a78459..53f9ae8d 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 f590e2e6..53cdceeb 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 a429e16a..85802dcb 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 efbc710a..20653212 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 58d76f33..00fa19a2 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 424ea26a..77db9b4c 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 4af7e5c2..2715b890 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 301b2315..766ed2fc 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 147cfdc4..113ff2e9 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 94cedfd3..504f13ff 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 aadc7667..d3205c22 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 a4aaadaf..888cc57f 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 0da50904..ec48a07c 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 78b39128..eb5b5b06 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 bbbf287e..e325432e 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 25d50ac1..fed8fc21 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 51d92868..97001f3c 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 ce801881..fb7d5c09 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 3e41fd1e..e633066b 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 40698050..3e35f3f7 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 daf2614c..e964b696 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 1d5d611f..df00588c 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 99b339bd..3713f4a8 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 1790fa55..f75caa42 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 5241dfaa..a55c7b40 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 edaf268b..0da71a98 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 22a6a4e9..916bff30 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 67e11dff..2d03dd0c 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 027879d9..bc3c0ed3 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 ef867d74..4f3e57c0 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 9839a043..8b0eb9f0 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 a05a0fab..a33c5f12 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 e5da7dcd..cc6657d0 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 c9393168..097a93e6 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 4e0d9a01..c7f5668b 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 697fd870..ba882c8b 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 9a56785b..d9cae711 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 214a91e4..9ed79016 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 6b6fb782..0aef8bd3 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 d1f54eca..0a41b3e3 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 e37d5abe..2510bb0d 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 de2b26ca..552e93f4 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 d187abf0..73e5b72a 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 2488f185..57b5861d 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 3661b16f..f39a6456 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 7a7b4803..f9f838f5 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 b5259f84..c17a102e 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 1ae353d3..836d6c8f 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 c911267e..06d0d9a0 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 05360203..5e0aa700 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 79ddb0fc..2dba7eca 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 8c7fb1a1..4666cbd0 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 8e0e412a..f71a457e 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 9d8cf8ea..41184f30 100644 --- a/mktypes.sh +++ b/mktypes.sh @@ -5,7 +5,7 @@ PKGS="cpu disk docker host load mem net process" GOOS=$(go env GOOS) 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 0f3a62f3..3890eda5 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 81feaa8d..df59abec 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 8c34f881..a45a5b75 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 e3fce902..f63a21e7 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 8a7b6374..f86b7bf9 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 0680d08a..86ed1262 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 e136be1b..e62deeee 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 bf8baf09..155a49c4 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 20ca5470..353e2dbb 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 bd5c9587..c173944a 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 a45072e9..f7a36879 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 88971967..2d01a1a4 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 eae0e71b..b7ccaa89 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 25bbe49c..16d4fa47 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 79d8ac30..b886066e 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 72f4db9c..43a48781 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 cb846e28..71fc3b97 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 5d384342..12f62cda 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 81aca011..c713f6b1 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 1bb27abf..669d8407 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 263829ff..dcc05610 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 176661cb..181a402b 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 b353e5ea..a1352247 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 cbd6bdc7..f1f3df36 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 858f08e7..bbdfc963 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 d903474f..129bb609 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 1a5d0c4b..78681bec 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 40b10e14..62841fd2 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 08ab333b..279ba9fb 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 560e627d..f3b70ec1 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 81ae0b9a..75ed3063 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 73ac0820..3dc301c0 100644 --- a/process/process_freebsd_arm64.go +++ b/process/process_freebsd_arm64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build freebsd && arm64 // Code generated by cmd/cgo -godefs; DO NOT EDIT. diff --git a/process/process_linux.go b/process/process_linux.go index 557435b3..8a6f5f53 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 87df8123..0adaddcd 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 35869406..af863949 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 6e9edc20..5b84706a 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 a46d28af..3229bb32 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 68ea3c8f..6f74ce75 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 fa620ff6..91045456 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 b677e70a..e3e0d36a 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 bc4bc062..9d059d29 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 a01f9ecf..caa9d3f7 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 201a58c9..2b114049 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 93c078d5..a91c4060 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 dd4bd476..5733b745 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 877992b2..100fcffd 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 f2053d98..a78afb7d 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 db4d4533..2b231c79 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 74c6212c..befe5213 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 3cde887d..7dc9351d 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 8dce0626..47d2bb89 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 ce771bc7..73a88560 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 c9957f72..07a56af1 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 93ec0e10..0c85a017 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