go-guru on linux code in non-linux system

207 Views Asked by At

We use docker and so the source code is for linux code. However, we develop on Macs, and as a result go-guru-callers fails to work when run locally. It complains with the error below but the error is because that property is linux specific:

/Users/uri/Documents/connect/src/connect/job/native.go:104:4: unknown field Pdeathsig in struct literal

and the code:

    cmd.SysProcAttr = &syscall.SysProcAttr{
        Pdeathsig: syscall.SIGKILL,
    }

Any workarounds?

1

There are 1 best solutions below

0
Adrian On

You can use build conditions to specify what code should be built on what OS and architecture, in order to separate out code that is platform-specific and avoid these kinds of compilation failures. See the go build documentation here.