You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ecs-cli/vendor/src/github.com/go-ini/ini/README.md
+101-6Lines changed: 101 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,8 +22,24 @@ Package ini provides INI file read and write functionality in Go.
22
22
23
23
## Installation
24
24
25
+
To use a tagged revision:
26
+
25
27
go get gopkg.in/ini.v1
26
28
29
+
To use with latest changes:
30
+
31
+
go get github.com/go-ini/ini
32
+
33
+
Please add `-u` flag to update in the future.
34
+
35
+
### Testing
36
+
37
+
If you want to test on your machine, please apply `-t` flag:
38
+
39
+
go get -t gopkg.in/ini.v1
40
+
41
+
Please add `-u` flag to update in the future.
42
+
27
43
## Getting Started
28
44
29
45
### Loading from data sources
@@ -46,6 +62,14 @@ When you cannot decide how many data sources to load at the beginning, you still
46
62
err:= cfg.Append("other file", []byte("other raw data"))
47
63
```
48
64
65
+
If you have a list of files with possibilities that some of them may not available at the time, and you don't know exactly which ones, you can use `LooseLoad` to ignore nonexistent files without returning error.
If you do not want any auto-transformation (such as recursive read) for the values, you can get raw value directly (this way you get much better performance):
167
+
168
+
```go
169
+
val:= cfg.Section("").Key("key name").Value()
170
+
```
171
+
172
+
To check if raw value exists:
173
+
174
+
```go
175
+
yes:= cfg.Section("").HasValue("test value")
176
+
```
177
+
125
178
To get value with types:
126
179
127
180
```go
128
181
// For boolean values:
129
-
// true when value is: 1, t, T, TRUE, true, True, YES, yes, Yes, ON, on, On
130
-
// false when value is: 0, f, F, FALSE, false, False, NO, no, No, OFF, off, Off
182
+
// true when value is: 1, t, T, TRUE, true, True, YES, yes, Yes, y, ON, on, On
183
+
// false when value is: 0, f, F, FALSE, false, False, NO, no, No, n, OFF, off, Off
0 commit comments