Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetDBConifgのパラメータをenviromentから取得する #4

Closed
t4jet opened this issue Nov 1, 2023 · 1 comment
Closed

GetDBConifgのパラメータをenviromentから取得する #4

t4jet opened this issue Nov 1, 2023 · 1 comment

Comments

@t4jet
Copy link
Owner

t4jet commented Nov 1, 2023

user := os.Getenv("DB_USER")
password := os.Getenv("DB_PASS")
hostname := os.Getenv("DB_HOST")
port := os.Getenv("DB_PORT")
dbname := os.Getenv("DB_NAME")

dsn := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=utf8mb4&parseTime=True&loc=Local", user, password, hostname, port, dbname)
@t4jet t4jet changed the title GetDBConifgのパラメータをenviromentkara GetDBConifgのパラメータをenviromentから取得する Nov 1, 2023
@t4jet
Copy link
Owner Author

t4jet commented Nov 1, 2023

fmt.Sprintfが動かない原因を探す

@t4jet t4jet mentioned this issue Nov 2, 2023
@t4jet t4jet closed this as completed Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant