跳转至主要内容

C'est La Vie

Go语言解析.ini配置文件

hliang
最后编辑于 2013年1月16日

在Github上找到的Go语言读取.ini配置文件的包,实用派。

https://github.com/polaris1119/goconfig

基本用法:

// 加载配置文件
c, _ := config.ReadDefault("config.cfg")

// 字符串值
c.String("service-1", "url")

// 整型值
c.Int("service-1", "maxclients")

// 布尔值
c.Bool("service-1", "delegation")
分类:

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注