Skip to content

Build vars

Luke Champine requested to merge build into master

This is a demonstration of how we might clean up our myriad release-dependent variables. The declarations are more compact, and no longer require a separate panic call. The downside is that a type assertion is required due to Select returning an interface{}. This type assertion will be hard to forget though, since any attempt to use the variable as e.g. an int will cause a compilation error.

I opted to only replace the vars in the miner package in order to avoid merge conflicts. If we decide to go ahead, we should also update the consensus set, gateway, transaction pool, and siad packages. The other packages are currently being overhauled, so we should delay updating them until their feature branches have been merged. Fortunately, it's easy to roll this out incrementally, since the existing method of selecting a build variable will continue to work as before.

EDIT: it occurred to me that we probably introduced some merge conflicts when we merged the Cmp64 PR. Drat :/

Merge request reports