github.com/metux/go-metabuild@v0.0.0-20240118143255-d9ed5ab697f9/spec/buildconf/forbuild.go (about) 1 package buildconf 2 3 import ( 4 "github.com/metux/go-metabuild/util" 5 ) 6 7 // Keys for target branch subtree underneath buildconf 8 const ( 9 KeyForBuild = Key("build") 10 KeyForHost = Key("host") 11 ) 12 13 // buildconf has subtrees for items specific to whether we're building for the 14 // (currently running) *build* machine or the final target *host* 15 // SubForBuild() retrieves the corresponding subtree as a SpecObj 16 // build=true means fetching for the currently building machine, otherwise the 17 // the target host 18 func (bc BuildConf) SubForBuild(build bool, k Key) SpecObj { 19 return bc.EntrySpec(util.ValIf(build, KeyForBuild, KeyForHost).Append(k)) 20 }