equal
deleted
inserted
replaced
1 // +build go1.6 |
|
2 |
|
3 // Copyright 2014 Unknwon |
1 // Copyright 2014 Unknwon |
4 // |
2 // |
5 // Licensed under the Apache License, Version 2.0 (the "License"): you may |
3 // Licensed under the Apache License, Version 2.0 (the "License"): you may |
6 // not use this file except in compliance with the License. You may obtain |
4 // not use this file except in compliance with the License. You may obtain |
7 // a copy of the License at |
5 // a copy of the License at |
23 "runtime" |
21 "runtime" |
24 "strings" |
22 "strings" |
25 ) |
23 ) |
26 |
24 |
27 const ( |
25 const ( |
28 // DefaultSection is the name of default section. You can use this constant or the string literal. |
|
29 // In most of cases, an empty string is all you need to access the section. |
|
30 DefaultSection = "DEFAULT" |
|
31 |
|
32 // Maximum allowed depth when recursively substituing variable names. |
26 // Maximum allowed depth when recursively substituing variable names. |
33 depthValues = 99 |
27 depthValues = 99 |
34 ) |
28 ) |
35 |
29 |
36 var ( |
30 var ( |
|
31 // DefaultSection is the name of default section. You can use this var or the string literal. |
|
32 // In most of cases, an empty string is all you need to access the section. |
|
33 DefaultSection = "DEFAULT" |
|
34 |
37 // LineBreak is the delimiter to determine or compose a new line. |
35 // LineBreak is the delimiter to determine or compose a new line. |
38 // This variable will be changed to "\r\n" automatically on Windows at package init time. |
36 // This variable will be changed to "\r\n" automatically on Windows at package init time. |
39 LineBreak = "\n" |
37 LineBreak = "\n" |
40 |
38 |
41 // Variable regexp pattern: %(variable)s |
39 // Variable regexp pattern: %(variable)s |
123 DebugFunc DebugFunc |
121 DebugFunc DebugFunc |
124 // ReaderBufferSize is the buffer size of the reader in bytes. |
122 // ReaderBufferSize is the buffer size of the reader in bytes. |
125 ReaderBufferSize int |
123 ReaderBufferSize int |
126 // AllowNonUniqueSections indicates whether to allow sections with the same name multiple times. |
124 // AllowNonUniqueSections indicates whether to allow sections with the same name multiple times. |
127 AllowNonUniqueSections bool |
125 AllowNonUniqueSections bool |
|
126 // AllowDuplicateShadowValues indicates whether values for shadowed keys should be deduplicated. |
|
127 AllowDuplicateShadowValues bool |
128 } |
128 } |
129 |
129 |
130 // DebugFunc is the type of function called to log parse events. |
130 // DebugFunc is the type of function called to log parse events. |
131 type DebugFunc func(message string) |
131 type DebugFunc func(message string) |
132 |
132 |