-
Notifications
You must be signed in to change notification settings - Fork 18k
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
go/build: document build comment requirements #3539
Labels
Milestone
Comments
I added the "// +build freebsd netbsd openbsd" to the top of the file and it still fails. I then added "// +build freebsd netbsd openbsd !windows" and it also failed. Ironically, its just the zmq_bsd.go that is failing. If I leave the zmq_linux.go there and remove the zmq_bsd.go, it will compile. |
Your zmq_bsd.go file starts with: >>> /* Copyright 2012 Alec Thomas Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // For some reason, Go on Windows tries to build both this file and zmq_windows.go. // +build !windows <<< This contradicts http://golang.org/pkg/go/build/#Build_Constraints: ... Constraints may appear in any kind of source file (not just Go), but they must be appear near the top of the file, preceded only by blank lines and other line comments. ... You have "general comment", not "line comment", in front of your build constrain. Follow Brad's advice, move "// +build !windows" line to the beginning of the file. Alex Status changed to WorkingAsIntended. |
Issue #3730 has been merged into this issue. |
Comment 13 by seed@mail.nanosouffle.net: rsc wrote: > I believe this is correct behavior now, but we need to document the behavior. Which behaviour? I don't think the format: "// +build foo /* other comment */ package bar" works yet. I feel that it should. I feel that in general, a `+build' directive as the very first line in the file should be taken into account. What do you feel about this? |
This issue was closed by revision 2e51f78. Status changed to Fixed. |
Issue #4985 has been merged into this issue. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
The text was updated successfully, but these errors were encountered: