## go 读取toml配置信息
toml配置文件后缀 .toml
```
Host = "127.0.0.1"
Username = "root"
Password = "root"
Port = "3306"
Dbname = "yourdb"
Tablename = "user"
```
go代码
```
package main
import (
"log"
"github.com/burntsnshi/toml"
)
func main(){
var conf Config
if _, err := toml.DecodeFile("./housesell.toml", &conf); err != nil {
// handle error
}
log.Println(conf.Host)
}
```
[toml GitHub地址](https://github.com/BurntSushi/toml)
有疑问加站长微信联系(非本文作者)