从Go中的.env或io.Reader加载环境变量。-Golang开发

时间:2021-05-26 16:46:51
【文件属性】:
文件名称:从Go中的.env或io.Reader加载环境变量。-Golang开发
文件大小:11KB
文件格式:ZIP
更新时间:2021-05-26 16:46:51
Golang Utilities gotenv在Go中动态加载环境变量。 安装$ go get github.com/subosito/gotenv用法将您的配置存储到项目根目录中的.env文件中:APP_ID = 1234 gotenv在Go中动态加载环境变量。 安装$ go get github.com/subosito/gotenv用法将您的配置存储到项目根目录中的.env文件中:APP_ID = 1234567 APP_SECRET = abcdef您还可以在每行前面添加导出,以便可以在bash:导出APP_ID = 1234567导出APP_SECRET = abcdef将gotenv包放在您的import语句上:import“ github.com/subosito/gotenv”然后在您的应用程序代码中的某处放:gote
【文件预览】:
gotenv-master
----go.mod(87B)
----.env(12B)
----.github()
--------workflows()
----go.sum(968B)
----.env.invalid(8B)
----fixtures()
--------yaml.env(54B)
--------quoted.env(104B)
--------bom.env(12B)
--------plain.env(59B)
--------exported.env(39B)
----gotenv.go(6KB)
----LICENSE(1KB)
----gotenv_test.go(9KB)
----README.md(4KB)
----.gitignore(27B)
----CHANGELOG.md(997B)

网友评论