Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'kIOMasterPortDefault' is deprecated: #1746

Open
x-gn opened this issue Nov 16, 2024 · 2 comments
Open

'kIOMasterPortDefault' is deprecated: #1746

x-gn opened this issue Nov 16, 2024 · 2 comments

Comments

@x-gn
Copy link

x-gn commented Nov 16, 2024

Describe the bug
smc_darwin.c:75:41: warning: 'kIOMasterPortDefault' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]

To Reproduce

import (
	"github.com/shirou/gopsutil/host"

Expected behavior
i want to get the mac os uptime using :
cmd := exec.Command("sysctl", "-n", "kern.boottime")

Environment (please complete the following information):
ProductName: macOS
ProductVersion: 12.7.6
BuildVersion: 21H1320

Darwin nydeMacBook-Air.local 21.6.0 Darwin Kernel Version 21.6.0: Mon Jun 24 00:56:10 PDT 2024; root:xnu-8020.240.18.709.2~1/RELEASE_X86_64 x86_64

Additional context

GO111MODULE='on'
GOARCH='amd64'
GOBIN='/usr/local/go/bin'
GOCACHE='/Users/ny/Library/Caches/go-build'
GOENV='/Users/ny/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/ny/workspace/projects/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/ny/workspace/projects/go'
GOPRIVATE=''
GOPROXY='https://goproxy.cn'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_amd64'
GOVCS=''
GOVERSION='go1.23.2'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/ny/Library/Application Support/go/telemetry'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='cc'
CXX='c++'
CGO_ENABLED='1'
GOMOD='/Users/ny/workspace/projects/go/src/monk/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/kp/y_f5v_sd48q_8gb9r448__vr0000gn/T/go-build3486157989=/tmp/go-build -gno-record-gcc-switches -fno-common'

@shirou
Copy link
Owner

shirou commented Nov 16, 2024

kIOMasterPortDefault is not used anymore. Please specify latest v4 gopsutil version.

@x-gn
Copy link
Author

x-gn commented Nov 16, 2024

ok , i will try it later, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants