Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b211f593
authored
Sep 30, 2025
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(main): conditionally log missing .env file message based on debug mode
parent
b6a3d809
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
main.go
+3
-2
No files found.
main.go
View file @
b211f593
...
@@ -185,8 +185,9 @@ func InitResources() error {
...
@@ -185,8 +185,9 @@ func InitResources() error {
// This is a placeholder function for future resource initialization
// This is a placeholder function for future resource initialization
err
:=
godotenv
.
Load
(
".env"
)
err
:=
godotenv
.
Load
(
".env"
)
if
err
!=
nil
{
if
err
!=
nil
{
common
.
SysLog
(
"未找到 .env 文件,使用默认环境变量,如果需要,请创建 .env 文件并设置相关变量"
)
if
common
.
DebugEnabled
{
common
.
SysLog
(
"No .env file found, using default environment variables. If needed, please create a .env file and set the relevant variables."
)
common
.
SysLog
(
"No .env file found, using default environment variables. If needed, please create a .env file and set the relevant variables."
)
}
}
}
// 加载环境变量
// 加载环境变量
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment