gouef/mode
Mode of project
Vesions
Introduction
Mode of project, like Release, Debug, Testing
Examples
Basic
package main
import "github.com/gouef/mode"
func main() {
m, err := mode.NewBasicMode()
if err != nil {
// do something
}
// some code
if r, _ := m.IsRelease(); r {
// some code
}
}
Additional modes
package main
import "github.com/gouef/mode"
func main() {
modes := []string{"staging"}
m, err := mode.NewMode(modes)
if err != nil {
// do something
}
// some code
if r, _ := m.IsRelease(); r {
m.EnableMode("staging")
}
if sm, _ := m.IsMode("staging"); sm {
// some code
}
}