Skip to content

Commit 258121b

Browse files
committed
Fix typos in Godoc comments
Some insignificant improvements to the comments resulting from a comprehensive review.
1 parent b1f2416 commit 258121b

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

debug.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import (
3434
"strings"
3535
)
3636

37-
// DebugExpandPropsInString output the substitutions made by
37+
// DebugExpandPropsInString outputs the substitutions made by
3838
// ExpandPropsInString for debugging purposes.
3939
func (m *Map) DebugExpandPropsInString(str string) string {
4040
return m.expandProps(str, true)

properties.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ syntax, for example:
5454
diecimila.build.variant=standard
5555
...
5656
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.
5858
5959
The Map internally keeps the insertion order so it can be retrieved later when
6060
cycling through the key sets.
6161
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
6363
on this kind of data like cloning, merging, comparing and also extracting
6464
a submap or generating a map-of-submaps from the first "level" of the hierarchy.
6565
@@ -106,7 +106,7 @@ func GetOSSuffix() string {
106106
return osSuffix
107107
}
108108

109-
// SetOSSuffix force the OS suffix to the given value
109+
// SetOSSuffix forces the OS suffix to the given value
110110
func SetOSSuffix(suffix string) {
111111
osSuffix = suffix
112112
}
@@ -201,13 +201,13 @@ func (m *Map) parseLine(line string) error {
201201
}
202202

203203
// 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
205205
func SafeLoadFromPath(path *paths.Path) (*Map, error) {
206206
return SafeLoad(path.String())
207207
}
208208

209209
// SafeLoad is like Load, except that it returns an empty Map if the specified
210-
// file doesn't exists
210+
// file doesn't exist
211211
func SafeLoad(filepath string) (*Map, error) {
212212
_, err := os.Stat(filepath)
213213
if os.IsNotExist(err) {
@@ -221,12 +221,12 @@ func SafeLoad(filepath string) (*Map, error) {
221221
return properties, nil
222222
}
223223

224-
// Get retrieve the value corresponding to key
224+
// Get retrieves the value corresponding to key
225225
func (m *Map) Get(key string) string {
226226
return m.kv[key]
227227
}
228228

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
230230
// to check if the key is present in the map (true if the key is present)
231231
func (m *Map) GetOk(key string) (string, bool) {
232232
v, ok := m.kv[key]
@@ -258,7 +258,7 @@ func (m *Map) Set(key, value string) {
258258
m.o = append(m.o, key)
259259
}
260260

261-
// Size return the number of elements in the map
261+
// Size returns the number of elements in the map
262262
func (m *Map) Size() int {
263263
return len(m.kv)
264264
}
@@ -299,7 +299,7 @@ func (m *Map) Remove(key string) {
299299
// "upload.maximum_size": "32256",
300300
// },
301301
// "diecimila" : properties.Map{
302-
// "name=Arduino Duemilanove or Diecimila
302+
// "name": "Arduino Duemilanove or Diecimila",
303303
// "upload.tool": "avrdude",
304304
// "upload.protocol": "arduino",
305305
// "bootloader.tool": "avrdude",
@@ -375,7 +375,7 @@ func (m *Map) FirstLevelKeys() []string {
375375
// "diecimila.bootloader.low_fuses": "0xFF",
376376
// }
377377
//
378-
// after calling SubTree("uno") will be transformed in:
378+
// after calling SubTree("uno") will be transformed into:
379379
//
380380
// properties.Map{
381381
// "name": "Arduino/Genuino Uno",
@@ -396,13 +396,13 @@ func (m *Map) SubTree(rootKey string) *Map {
396396
return newMap
397397
}
398398

399-
// ExpandPropsInString use the Map to replace values into a format string.
399+
// ExpandPropsInString uses the Map to replace values into a format string.
400400
// The format string should contains markers between braces, for example:
401401
//
402402
// "The selected upload protocol is {upload.protocol}."
403403
//
404404
// 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
406406
// recursively up to 10 times.
407407
func (m *Map) ExpandPropsInString(str string) string {
408408
return m.expandProps(str, false)
@@ -495,7 +495,7 @@ func (m *Map) EqualsWithOrder(other *Map) bool {
495495
return reflect.DeepEqual(m.o, other.o) && reflect.DeepEqual(m.kv, other.kv)
496496
}
497497

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
499499
// target map-of-Maps.
500500
func MergeMapsOfProperties(target map[string]*Map, sources ...map[string]*Map) map[string]*Map {
501501
for _, source := range sources {

0 commit comments

Comments
 (0)