Golang module, that imports all files in a folder, and assigns the names and value, as env variables.
Usecase is Kubernetes Service Bindings, where the secrets, are attached to the container, as files.
This allows you to easy extract the secrets, and map them as env variables, to be used in your code.
Run the following to install the package
go get github.com/rhjensen79/files2env@v0.7.7
The following example, shows how to import secrets, from a ./secrets folder
package main
import (
"github.com/rhjensen79/files2env"
)
func main() {
files2env.Import("./secrets")
}
If you find issues, then feel free to create and issue, or help with making the code better.