aboutsummaryrefslogtreecommitdiff
path: root/gorankusu.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2024-02-21 01:51:22 +0700
committerShulhan <ms@kilabit.info>2024-02-21 01:51:34 +0700
commitf08f1c15ff863d2829af8be8ddf392e9241d0f89 (patch)
tree1aa0066384ca66345cb526103c4b39797f30aa18 /gorankusu.go
parente8d3716995e9229a61a32894689c379e22475420 (diff)
downloadgorankusu-f08f1c15ff863d2829af8be8ddf392e9241d0f89.tar.xz
all: move reading GORANKUSU_DEV environment to [Environment.IsDevelopment]
Diffstat (limited to 'gorankusu.go')
-rw-r--r--gorankusu.go11
1 files changed, 2 insertions, 9 deletions
diff --git a/gorankusu.go b/gorankusu.go
index b8aec82..dfec004 100644
--- a/gorankusu.go
+++ b/gorankusu.go
@@ -19,10 +19,6 @@ import (
// Version of gorankusu module.
const Version = `0.5.0`
-// EnvDevelopment setting this environment variable will enable gorankusu
-// development mode.
-const EnvDevelopment = "GORANKUSU_DEV"
-
// Gorankusu is the HTTP server with web user interface and APIs for running and
// load testing the registered HTTP endpoints.
type Gorankusu struct {
@@ -39,10 +35,7 @@ type Gorankusu struct {
// New create and initialize new Gorankusu service.
func New(env *Environment) (gorankusu *Gorankusu, err error) {
- var (
- logp = "gorankusu.New"
- isDevelopment = len(os.Getenv(EnvDevelopment)) > 0
- )
+ var logp = `New`
err = env.init()
if err != nil {
@@ -57,7 +50,7 @@ func New(env *Environment) (gorankusu *Gorankusu, err error) {
navLinks: make([]*NavLink, 0, 1),
}
- err = gorankusu.initHTTPServer(isDevelopment)
+ err = gorankusu.initHTTPServer(env.IsDevelopment)
if err != nil {
return nil, fmt.Errorf("%s: %w", logp, err)
}