Skip to content
Myr

Use camel case instead of ALL_CAPS (#1419)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* Use camel case instead of ALL_CAPS * Update mode.go

authored by David Zhang · committed by 田欧 · parent 48f6c61 · Browse files · 2 files+5 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+5 added−5 removed

  • other:+5 added−5 removed

2 files+5 added−5 removed

modified:mode_test.go+2 added-2 removed
11 unmodified lines
12 "github.com/stretchr/testify/assert"13)1415func init() {16 os.Setenv(ENV_GIN_MODE, TestMode)16 os.Setenv(EnvGinMode, TestMode)17}1819func TestSetMode(t *testing.T) {20 assert.Equal(t, testCode, ginMode)21 assert.Equal(t, TestMode, Mode())22 os.Unsetenv(ENV_GIN_MODE)22 os.Unsetenv(EnvGinMode)2324 SetMode("")25 assert.Equal(t, debugCode, ginMode)26 assert.Equal(t, DebugMode, Mode())
21 unmodified lines
modified:mode.go+3 added-3 removed
9 unmodified lines
1011 "github.com/gin-gonic/gin/binding"12)1314// ENV_GIN_MODE indicates environment name for gin mode.15const ENV_GIN_MODE = "GIN_MODE"14// EnvGinMode indicates environment name for gin mode.15const EnvGinMode = "GIN_MODE"1617const (18 // DebugMode indicates gin mode is debug.19 DebugMode = "debug"
23 unmodified lines
43var ginMode = debugCode44var modeName = DebugMode4546func init() {47 mode := os.Getenv(ENV_GIN_MODE)47 mode := os.Getenv(EnvGinMode)48 SetMode(mode)49}5051// SetMode sets gin mode according to input string.
32 unmodified lines