Initial commit
This commit is contained in:
parent
0123ffc572
commit
cb85168cbd
5
main.go
5
main.go
@ -8,6 +8,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -20,7 +22,8 @@ var (
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// Load .env file
|
// Load .env file
|
||||||
err := godotenv.Load()
|
_, b, _, _ := runtime.Caller(0) // @refactor
|
||||||
|
err := godotenv.Load(filepath.Join(filepath.Dir(b), ".env"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Error loading .env file:", err)
|
fmt.Println("Error loading .env file:", err)
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user