-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Hi, I'm trying to run the project locally, on macos, and I'm having trouble.
To reproduce my problem, you can try compiling the project for macos/windows:
# GOOS=darwin GOARCH=arm64 go build cmd/*.go
GOOS=windows GOARCH=amd64 go build cmd/*.go
cmd/init.go:705:19: undefined: syscall.Utsname
cmd/init.go:712:20: undefined: syscall.Uname
cmd/settings.go:302:19: undefined: syscall.Utsname
cmd/settings.go:307:20: undefined: syscall.Uname
uname
syscall is only available for linux in golang. This code does not compile on macos/windows:
Lines 703 to 714 in a440b79
var ( | |
mem runtime.MemStats | |
utsname syscall.Utsname | |
) | |
// Memory / alloc stats. | |
runtime.ReadMemStats(&mem) | |
// OS info. | |
if err := syscall.Uname(&utsname); err != nil { | |
lo.Printf("WARNING: error getting system info: %v", err) | |
} |
A more portable way to write that bit of code is to use Utsname
and Uname
from the golang.org/x/sys/unix
package, but that does not work for windows.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request