@@ -44,6 +44,15 @@ func main() {
4444 // logging start of TibiaData
4545 log .Printf ("[info] TibiaData API starting.." )
4646
47+ // running the TibiaDataInitializer function
48+ TibiaDataInitializer ()
49+
50+ // logging build information
51+ log .Printf ("[info] TibiaData API release: %s" , TibiadataBuildRelease )
52+ log .Printf ("[info] TibiaData API build: %s" , TibiadataBuildBuilder )
53+ log .Printf ("[info] TibiaData API commit: %s" , TibiadataBuildCommit )
54+ log .Printf ("[info] TibiaData API edition: %s" , TibiadataBuildEdition )
55+
4756 // setting application to ReleaseMode if DEBUG_MODE is false
4857 if ! getEnvAsBool ("DEBUG_MODE" , false ) {
4958 // setting GIN_MODE to ReleaseMode
@@ -124,16 +133,18 @@ func main() {
124133 })
125134 })
126135
127- // logging build information
128- log .Printf ("[info] TibiaData API release: %s" , TibiadataBuildRelease )
129- log .Printf ("[info] TibiaData API build: %s" , TibiadataBuildBuilder )
130- log .Printf ("[info] TibiaData API commit: %s" , TibiadataBuildCommit )
131- log .Printf ("[info] TibiaData API edition: %s" , TibiadataBuildEdition )
132-
133136 // Start the router
134137 router .Run () // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")
135138}
136139
140+ // TibiaDataInitializer func - init things at beginning
141+ func TibiaDataInitializer () {
142+ // setting TibiadataBuildEdition
143+ if isEnvExist ("TIBIADATA_EDITION" ) {
144+ TibiadataBuildEdition = getEnv ("TIBIADATA_EDITION" , "open-source" )
145+ }
146+ }
147+
137148/*
138149// TibiaDataAPIHandleErrorResponse func - handling of responses..
139150func TibiaDataAPIHandleErrorResponse(c *gin.Context, s1 string, s2 string, s3 string) {
@@ -176,11 +187,6 @@ func TibiadataUserAgentGenerator(version int) string {
176187 TibiadataHost = "+https://" + TibiadataHost
177188 }
178189
179- // setting TibiadataBuildEdition
180- if isEnvExist ("TIBIADATA_EDITION" ) {
181- TibiadataBuildEdition = getEnv ("TIBIADATA_EDITION" , "open-source" )
182- }
183-
184190 // adding details in parenthesis
185191 useragentDetails := []string {
186192 "release/" + TibiadataBuildRelease ,
0 commit comments