github.com/decred/dcrlnd@v0.7.6/build/deployment.go (about) 1 package build 2 3 // DeploymentType is an enum specifying the deployment to compile. 4 type DeploymentType byte 5 6 const ( 7 // Development is a deployment that includes extra testing hooks and 8 // logging configurations. 9 Development DeploymentType = iota 10 11 // Production is a deployment that strips out testing logic and uses 12 // Default logging. 13 Production 14 ) 15 16 // String returns a human readable name for a build type. 17 func (b DeploymentType) String() string { 18 switch b { 19 case Development: 20 return "development" 21 case Production: 22 return "production" 23 default: 24 return "unknown" 25 } 26 } 27 28 // IsProdBuild returns true if this is a production build. 29 func IsProdBuild() bool { 30 return Deployment == Production 31 } 32 33 // IsDevBuild returns true if this is a development build. 34 func IsDevBuild() bool { 35 return Deployment == Development 36 }