해결된 질문
작성
·
237
·
수정됨
2
현재 export로 WEBAPP_VAR를 삽입하고
export WEBAPP_VAR=bailey
grep으로 확인까지 했는데
export | grep WEBAPP_VAR
WEBAPP_VAR=bailey
go-web-application-windows.exe을 실행시켜도
./go-web-application-windows.exe
2024/05/03 00:22:39 This is GO-WEB-APPLICATION
2024/05/03 00:22:39 INFO: Application is initializing...
2024/05/03 00:22:39 INFO: Configuration files are being read...
2024/05/03 00:22:39 WARN: Debug mode is enabled.
2024/05/03 00:22:39 DEBUG: Verbose logging is activated for debugging.
2024/05/03 00:22:39 WARN: Example warning message.
2024/05/03 00:22:39 WARN: Another warning, maybe related to configuration.
2024/05/03 00:22:39 INFO: Starting server on port 8080...
2024/05/03 00:22:39 INFO: Server is ready to receive requests.
2024/05/03 00:22:39 INFO: Listening for connections...
2024/05/03 00:22:39 INFO: Health checks are running.
2024/05/03 00:22:39 INFO: WEBAPP_VAR 환경변수는 입니다.
2024/05/03 00:22:39 Starting server on :8080
2024/05/03 00:22:39 INFO: WEBAPP_VAR 환경변수는 입니다.
WEBAPP_VAR가 출력 되지 않습니다. (공백)
답변 1
1
확인 결과,
GitBash에서 WATCH가 안되서, WSL을 이용했었는데 WSL에서 적용이 되지 않았습니다.
GitBash로 적용하니 정상적으로 적용되었습니다.
export WEBAPP_VAR=bailey
export | grep WEBAPP_VAR
declare -x WEBAPP_VAR="bailey"
./go-web-application-windows.exe
2024/05/03 00:48:28 This is GO-WEB-APPLICATION
2024/05/03 00:48:29 INFO: Application is initializing...
2024/05/03 00:48:29 INFO: Configuration files are being read...
2024/05/03 00:48:29 WARN: Debug mode is enabled.
2024/05/03 00:48:29 DEBUG: Verbose logging is activated for debugging.
2024/05/03 00:48:29 WARN: Example warning message.
2024/05/03 00:48:29 WARN: Another warning, maybe related to configuration.
2024/05/03 00:48:29 INFO: Starting server on port 8080...
2024/05/03 00:48:29 INFO: Server is ready to receive requests.
2024/05/03 00:48:29 INFO: Listening for connections...
2024/05/03 00:48:29 INFO: Health checks are running.
2024/05/03 00:48:29 INFO: WEBAPP_VAR 환경변수는 bailey 입니다.
2024/05/03 00:48:29 Starting server on :8080
2024/05/03 00:48:29 INFO: WEBAPP_VAR 환경변수는 bailey 입니다.
성공