#development #golang #reading-list
🔗 How to use conditional compilation with the go build tool
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/buildpackage 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.
⚠️ 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.