We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 212a84f commit 62d90e5Copy full SHA for 62d90e5
properties.go
@@ -232,8 +232,16 @@ func (m Map) FirstLevelOf() map[string]Map {
232
// "upload.protocol": "arduino",
233
// "upload.maximum_size": "32256",
234
// },
235
-func (m Map) SubTree(key string) Map {
236
- return m.FirstLevelOf()[key]
+func (m Map) SubTree(rootKey string) Map {
+ rootKey += "."
237
+ newMap := Map{}
238
+ for key, value := range m {
239
+ if !strings.HasPrefix(key, rootKey) {
240
+ continue
241
+ }
242
+ newMap[key[len(rootKey):]] = value
243
244
+ return newMap
245
}
246
247
// ExpandPropsInString use the Map to replace values into a format string.
0 commit comments