@@ -54,12 +54,12 @@ syntax, for example:
54
54
diecimila.build.variant=standard
55
55
...
56
56
57
- This library has methods to parse this kind of files into a Map object.
57
+ This library has methods to parse this kind of file into a Map object.
58
58
59
59
The Map internally keeps the insertion order so it can be retrieved later when
60
60
cycling through the key sets.
61
61
62
- The Map object has many helper methods to accomplish some common operation
62
+ The Map object has many helper methods to accomplish some common operations
63
63
on this kind of data like cloning, merging, comparing and also extracting
64
64
a submap or generating a map-of-submaps from the first "level" of the hierarchy.
65
65
@@ -106,7 +106,7 @@ func GetOSSuffix() string {
106
106
return osSuffix
107
107
}
108
108
109
- // SetOSSuffix force the OS suffix to the given value
109
+ // SetOSSuffix forces the OS suffix to the given value
110
110
func SetOSSuffix (suffix string ) {
111
111
osSuffix = suffix
112
112
}
@@ -201,13 +201,13 @@ func (m *Map) parseLine(line string) error {
201
201
}
202
202
203
203
// SafeLoadFromPath is like LoadFromPath, except that it returns an empty Map if
204
- // the specified file doesn't exists
204
+ // the specified file doesn't exist
205
205
func SafeLoadFromPath (path * paths.Path ) (* Map , error ) {
206
206
return SafeLoad (path .String ())
207
207
}
208
208
209
209
// SafeLoad is like Load, except that it returns an empty Map if the specified
210
- // file doesn't exists
210
+ // file doesn't exist
211
211
func SafeLoad (filepath string ) (* Map , error ) {
212
212
_ , err := os .Stat (filepath )
213
213
if os .IsNotExist (err ) {
@@ -221,12 +221,12 @@ func SafeLoad(filepath string) (*Map, error) {
221
221
return properties , nil
222
222
}
223
223
224
- // Get retrieve the value corresponding to key
224
+ // Get retrieves the value corresponding to key
225
225
func (m * Map ) Get (key string ) string {
226
226
return m .kv [key ]
227
227
}
228
228
229
- // GetOk retrieve the value corresponding to key and return a true/false indicator
229
+ // GetOk retrieves the value corresponding to key and returns a true/false indicator
230
230
// to check if the key is present in the map (true if the key is present)
231
231
func (m * Map ) GetOk (key string ) (string , bool ) {
232
232
v , ok := m .kv [key ]
@@ -258,7 +258,7 @@ func (m *Map) Set(key, value string) {
258
258
m .o = append (m .o , key )
259
259
}
260
260
261
- // Size return the number of elements in the map
261
+ // Size returns the number of elements in the map
262
262
func (m * Map ) Size () int {
263
263
return len (m .kv )
264
264
}
@@ -299,7 +299,7 @@ func (m *Map) Remove(key string) {
299
299
// "upload.maximum_size": "32256",
300
300
// },
301
301
// "diecimila" : properties.Map{
302
- // "name= Arduino Duemilanove or Diecimila
302
+ // "name": " Arduino Duemilanove or Diecimila",
303
303
// "upload.tool": "avrdude",
304
304
// "upload.protocol": "arduino",
305
305
// "bootloader.tool": "avrdude",
@@ -375,7 +375,7 @@ func (m *Map) FirstLevelKeys() []string {
375
375
// "diecimila.bootloader.low_fuses": "0xFF",
376
376
// }
377
377
//
378
- // after calling SubTree("uno") will be transformed in :
378
+ // after calling SubTree("uno") will be transformed into :
379
379
//
380
380
// properties.Map{
381
381
// "name": "Arduino/Genuino Uno",
@@ -396,13 +396,13 @@ func (m *Map) SubTree(rootKey string) *Map {
396
396
return newMap
397
397
}
398
398
399
- // ExpandPropsInString use the Map to replace values into a format string.
399
+ // ExpandPropsInString uses the Map to replace values into a format string.
400
400
// The format string should contains markers between braces, for example:
401
401
//
402
402
// "The selected upload protocol is {upload.protocol}."
403
403
//
404
404
// Each marker is replaced by the corresponding value of the Map.
405
- // The values in the Map may contains other markers, they are evaluated
405
+ // The values in the Map may contain other markers, they are evaluated
406
406
// recursively up to 10 times.
407
407
func (m * Map ) ExpandPropsInString (str string ) string {
408
408
return m .expandProps (str , false )
@@ -495,7 +495,7 @@ func (m *Map) EqualsWithOrder(other *Map) bool {
495
495
return reflect .DeepEqual (m .o , other .o ) && reflect .DeepEqual (m .kv , other .kv )
496
496
}
497
497
498
- // MergeMapsOfProperties merge the map-of-Maps (obtained from the method FirstLevelOf()) into the
498
+ // MergeMapsOfProperties merges the map-of-Maps (obtained from the method FirstLevelOf()) into the
499
499
// target map-of-Maps.
500
500
func MergeMapsOfProperties (target map [string ]* Map , sources ... map [string ]* Map ) map [string ]* Map {
501
501
for _ , source := range sources {
0 commit comments