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

there is no cmd:#define,so how can i compile my program with change any code at any platform? #40997

Closed
rhettli opened this issue Aug 24, 2020 · 2 comments

Comments

@rhettli
Copy link

rhettli commented Aug 24, 2020

go version go1.14.2 darwin/amd64

the code below work correct on win,but fail on mac,

cmd.SysProcAttr = &syscall.SysProcAttr{}
// HideWindow attr was not exist on mac platfrom ,so i had to change it when i compile code on mac platfrom.
cmd.HideWindow = true

if there have #define cmd: just change like :

cmd.SysProcAttr = &syscall.SysProcAttr{}
#ifdefine _WINDOWS
cmd.HideWindow = true
#enddefine 

And how can i compile the program without change any code on any playform?

@acln0
Copy link
Contributor

acln0 commented Aug 24, 2020

https://golang.org/cmd/go/#hdr-Build_constraints

In the future, please use one of these venues https://golang.org/help/#help for questions rather than the issue tracker.

@davecheney
Copy link
Contributor

Thank you for raising this issue. Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.

For asking questions, see:

@golang golang locked and limited conversation to collaborators Aug 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants