util

package
v0.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DevelopmentEnv is the name of the environment variable used to mark the running mode of the application
	DevelopmentEnv = "GO_ENV"
	// WorkingPathEnv is the name of the environment variable used to mark the directory where the application runs
	WorkingPathEnv = "GO_WORKING_PATH"

	// DEV is a development pattern markup constant
	DEV = "development"
	// TESTING is a testing pattern markup constant
	TESTING = "testing"
	// PROD is a production pattern markup constant
	PROD = "production"
)

Variables

This section is empty.

Functions

func Development

func Development() bool

Development determines whether or not it is currently in development mode GO_ENV = development

func Env

func Env(name string) string

Env gets the specified environment variable

func GOENV

func GOENV() string

GOENV gets application running mode

func Production

func Production() bool

Production determines whether or not it is currently in production mode GO_ENV != testing && GO_ENV != development

func SetEnv

func SetEnv(name, value string) error

SetEnv sets environment variable

func Testing

func Testing() bool

Testing determines whether or not it is currently in testing mode GO_ENV = testing

Types

This section is empty.

Directories

Path Synopsis
pio
Package strftime is forked from https://github.com/lestrrat-go/strftime 仅保留针对字符串的 format
Package strftime is forked from https://github.com/lestrrat-go/strftime 仅保留针对字符串的 format

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL