## Mix Dotenv
基于 [GoDotEnv](https://github.com/joho/godotenv) 開發的具有 **類型轉換功能** 的環境配置庫
Based on GoDotEnv library, with type conversion function
## Usage
- 安裝
```
go get -u github.com/mix-go/dotenv
```
- 加載 `.env` 文件
不加載文件也可以獲取系統環境變量,`Load` 方法并不是必須的
~~~
err := dotenv.Load(".env")
~~~
- 獲取環境配置
獲取值
~~~
dotenv.Getenv("key").String()
dotenv.Getenv("key").Bool()
dotenv.Getenv("key").Int64()
dotenv.Getenv("key").Float64()
~~~
獲取值,當不存在時返回默認值
~~~
dotenv.Getenv("key").String("default")
dotenv.Getenv("key").Bool(false)
dotenv.Getenv("key").Int64(123)
dotenv.Getenv("key").Float64(123.4)
~~~
## License
Apache License Version 2.0, http://www.apache.org/licenses/