takama / daemon

A daemon package for use with Go (golang) services

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question about switch-case `GOOS`

yangbinnnn opened this issue · comments

I'm a beginner of golang, daemon is a great project, let me create daemon program fast.
The interesting thing is that how daemon switch-case the GOOS ?

ps: Is it a trick of execPath or os.Executable()?

It's golang's build constrains, https://golang.org/pkg/go/build/#hdr-Build_Constraints.

*_GOOS.go: source_linux.go
*_GOOS_GOARCH.go: source_darwin_amd64.go