Tutorial by Examples

Build constraints are commonly used to separate normal unit tests from integration tests that require external resources, like a database or network access. To do this, add a custom build constraint to the top of the test file: // +build integration package main import ( "testing&...
We can optimize a simple xor function for only architectures that support unaligned reads/writes by creating two files that define the function and prefixing them with a build constraint (for an actual example of the xor code which is out of scope here, see crypto/cipher/xor.go in the standard libra...

Page 1 of 1