Skip to content
gouefPublic

About

Mode of project

Resources

Stars

1 star

Watchers

1 watching

Forks

 
 

Latest commit

 

History

12 Commits

Folders and files

Repository files navigation

gouef/mode

Mode of project

GoDoc GitHub stars Go Report Card codecov

Vesions

Stable Version GitHub Release GitHub Release

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
	}
}

About

Mode of project

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages