Skip to content

Commit

Permalink
Use camel case instead of ALL_CAPS
Browse files Browse the repository at this point in the history
  • Loading branch information
crispgm committed Jul 2, 2018
1 parent 1c4cbfa commit c88d36b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions mode.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/gin-gonic/gin/binding"
)

const ENV_GIN_MODE = "GIN_MODE"
const EnvGinMode = "GIN_MODE"

const (
DebugMode = "debug"
Expand All @@ -38,7 +38,7 @@ var ginMode = debugCode
var modeName = DebugMode

func init() {
mode := os.Getenv(ENV_GIN_MODE)
mode := os.Getenv(EnvGinMode)
SetMode(mode)
}

Expand Down
4 changes: 2 additions & 2 deletions mode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import (
)

func init() {
os.Setenv(ENV_GIN_MODE, TestMode)
os.Setenv(EnvGinMode, TestMode)
}

func TestSetMode(t *testing.T) {
assert.Equal(t, testCode, ginMode)
assert.Equal(t, TestMode, Mode())
os.Unsetenv(ENV_GIN_MODE)
os.Unsetenv(EnvGinMode)

SetMode("")
assert.Equal(t, debugCode, ginMode)
Expand Down

0 comments on commit c88d36b

Please sign in to comment.