From 8835f4c49e9c349d2d48cb6037f69d4373c95f36 Mon Sep 17 00:00:00 2001 From: xiaoqidun Date: Fri, 25 Oct 2019 18:44:15 +0800 Subject: [PATCH] Create README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加说明文件 --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..5d5cccc --- /dev/null +++ b/README.md @@ -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将[](英文中括号)识别为分区