mirror of
https://github.com/xiaoqidun/goini.git
synced 2024-11-22 14:36:46 +08:00
Merge branch 'master' of github.com:xiaoqidun/goini
This commit is contained in:
commit
83519f6d80
26
README.md
Normal file
26
README.md
Normal file
@ -0,0 +1,26 @@
|
||||
# GoINI
|
||||
简单易用的Golang INI配置解析库
|
||||
# 安装方法
|
||||
go get -u github.com/xiaoqidun/goini
|
||||
# 读取配置
|
||||
## 从文件读取配置
|
||||
```go
|
||||
//初始GoINI对象
|
||||
ini := goini.NewGoINI()
|
||||
//从文件获取配置
|
||||
if err := ini.LoadFile("./config.ini"); err != nil {
|
||||
log.Println(err)
|
||||
return
|
||||
}
|
||||
```
|
||||
## 从字符读取配置
|
||||
```go
|
||||
//初始GoINI对象
|
||||
ini := goini.NewGoINI()
|
||||
//从字符获取配置
|
||||
ini.SetData([]byte(""))
|
||||
```
|
||||
# 注释方法
|
||||
goini将;或#开头的行识别为注释信息
|
||||
# 分区支持
|
||||
goini将[](英文中括号)识别为分区
|
Loading…
x
Reference in New Issue
Block a user