Skip to content

Commit 3d54653

Browse files
maishivamhoo123LinkinStars
authored andcommitted
fix: added the init fuction in install_main.go
1 parent f6d30a5 commit 3d54653

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

internal/install/install_main.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,20 @@ import (
2525

2626
"github.com/apache/answer/internal/base/path"
2727
"github.com/apache/answer/internal/base/translator"
28+
"github.com/joho/godotenv"
2829
)
2930

3031
var (
31-
port = os.Getenv("INSTALL_PORT")
32+
port string
3233
confPath = ""
3334
)
3435

36+
func init() {
37+
_ = godotenv.Load()
38+
port = os.Getenv("INSTALL_PORT")
39+
40+
}
41+
3542
func Run(configPath string) {
3643
confPath = configPath
3744
// initialize translator for return internationalization error when installing.

0 commit comments

Comments
 (0)