Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Commit d2305a0

Browse files
committed
split util func
1 parent fcf47bf commit d2305a0

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

BlockStorage.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,6 @@ func resource_n0stack_blockstorage() *schema.Resource {
5353
}
5454
}
5555

56-
func interfaceMap2stringMap(input map[string]interface{}) map[string]string {
57-
output := make(map[string]string)
58-
for key, value := range input {
59-
output[key] = value.(string)
60-
}
61-
return output
62-
}
63-
6456
func resource_n0stack_blockstorage_create(d *schema.ResourceData, meta interface{}) error {
6557
config := meta.(Config)
6658
conn, err := grpc.Dial(config.endpoint, grpc.WithInsecure())

utils.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package main
2+
3+
func interfaceMap2stringMap(input map[string]interface{}) map[string]string {
4+
output := make(map[string]string)
5+
for key, value := range input {
6+
output[key] = value.(string)
7+
}
8+
return output
9+
}
10+
11+
func interfaceList2stringList(input []interface{}) []string {
12+
output := make([]string, len(input))
13+
for key, value := range input {
14+
output = append(output,value.(string))
15+
}
16+
return output
17+
}

0 commit comments

Comments
 (0)