We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
When developing Go packages that rely on specific features of the underlying platform or processor it is often necessary to provide a specialised implementation.
Go does not have a preprocessor, a macro system, or a #define declaration to control the inclusion of platform specific code. Instead a system of tags and naming convention defined in the
go/build
package and supported by the go tool allows Go packages to customise themselves for the specific platform they are being compiled for.This post explains how conditional compilation is implemented and show you how you can use it in your projects.
continue reading on dave.cheney.net
⚠️ This post links to an external website. ⚠️
If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts, subscribe use the RSS feed.