https://github.com/bmf-san/goemon
A dotenv built with golang.
https://github.com/bmf-san/goemon
dotenv golang
Last synced: about 1 year ago
JSON representation
A dotenv built with golang.
- Host: GitHub
- URL: https://github.com/bmf-san/goemon
- Owner: bmf-san
- License: mit
- Created: 2019-10-01T04:09:42.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-11-01T05:06:14.000Z (over 5 years ago)
- Last Synced: 2025-02-01T18:45:23.322Z (over 1 year ago)
- Topics: dotenv, golang
- Language: Go
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# goemon
[](https://circleci.com/gh/bmf-san/goemon/tree/master)
A dotenv built with golang.
# Installation
`go get github.com/bmf-san/goemon`
# Get Started
Add a .env file in your project.
```
FOO=foo
BAR=bar
```
Then you can load env file like this.
```golang
package main
import (
"fmt"
"os"
"github.com/bmf-san/goemon"
)
func main() {
if err := dotenv.LoadEnv(); err != nil {
fmt.Printf("%s", err)
}
fmt.Println(os.Getenv("FOO")) // foo
fmt.Println(os.Getenv("BAR")) // bar
}
```