Skip to content

Commit

Permalink
env String()
Browse files Browse the repository at this point in the history
Signed-off-by: Dusan Malusev <dusan@dusanmalusev.dev>
  • Loading branch information
CodeLieutenant committed May 7, 2024
1 parent 3b8aad8 commit b05b05f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions environment/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,18 @@ func MustParse(env string) Env {

return e
}

func (e Env) String() string {
switch e {
case Production:
return "production"
case Development:
return "development"
case Testing:
return "testing"
case Staging:
return "staging"
default:
panic("invalid environment")
}
}

0 comments on commit b05b05f

Please sign in to comment.