Closed redanthrax closed 2 years ago
@wh1te909 I don't suppose we can get this merged in?
needs to just be refactored with build tags because it's exactly same as linux agent code so we can just have 1 file with a build tag for both linux and darwin instead of duplicate files
go 1.19 will add a unix build constraint so we can just put all linux and mac stuff into the same file called agent_unix.go
https://tip.golang.org/doc/go1.19#go-unix
Until that is released, we can still create a file named agent_unix.go
and get rid of agent_linux.go
and just use build tags at the top of the file like this // +build !windows
if there are linux or mac specific functions that are not shared, then we can keep agent_linux.go
and agent_darwin.go
and put them in there, but most of the stuff will move to agent_unix.go
Must use the following for build. Must have CGO enabled. env GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w" -o bin/macagent