Use gopsutil for cross-platform process detection

Replace pgrep with gopsutil/v4 for pure Go process detection.
Now fully cross-platform (Linux, FreeBSD, macOS, Windows) with
zero external exec calls. Add Taskfile and test fixture.
This commit is contained in:
2025-12-18 05:41:19 +01:00
parent f1ca1ccaa0
commit 1cca87af90
6 changed files with 172 additions and 5 deletions

8
go.mod
View File

@ -4,6 +4,7 @@ go 1.24.11
require (
github.com/go-git/go-git/v6 v6.0.0-20251216093047-22c365fcee9c
github.com/shirou/gopsutil/v4 v4.25.11
golang.org/x/sys v0.39.0
)
@ -12,14 +13,21 @@ require (
github.com/ProtonMail/go-crypto v1.3.0 // indirect
github.com/cloudflare/circl v1.6.1 // indirect
github.com/cyphar/filepath-securejoin v0.6.1 // indirect
github.com/ebitengine/purego v0.9.1 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/go-git/gcfg/v2 v2.0.2 // indirect
github.com/go-git/go-billy/v6 v6.0.0-20251209065551-8afc3eb64e4d // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
github.com/kevinburke/ssh_config v1.4.0 // indirect
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/pjbgf/sha1cd v0.5.0 // indirect
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
github.com/sergi/go-diff v1.4.0 // indirect
github.com/tklauser/go-sysconf v0.3.16 // indirect
github.com/tklauser/numcpus v0.11.0 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
golang.org/x/crypto v0.46.0 // indirect
golang.org/x/net v0.48.0 // indirect
)