-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstring.go
More file actions
executable file
·55 lines (47 loc) · 1.24 KB
/
Copy pathstring.go
File metadata and controls
executable file
·55 lines (47 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package gopherneo
import "bytes"
func joinPath(strings []string) string {
return joinUsing(strings, "/")
}
func join(strings []string) string {
var buffer bytes.Buffer
for _, s := range strings {
buffer.WriteString(s)
}
return buffer.String()
}
func joinUsing(strings []string, delimiter string) string {
var buffer bytes.Buffer
for ndx, s := range strings {
buffer.WriteString(s)
if ndx != len(strings)-1 {
buffer.WriteString(delimiter)
}
}
return buffer.String()
}
// func propsToCypherString(label string, props map[string]interface{}, alias string) (result string) {
// // create a slice of keys, values
// propParts := []string{}
// for k, v := range props {
// key := k
// value := ""
// switch v.(type) {
// case int:
// value = strconv.Itoa(v.(int))
// // TODO support floats. ** figure out how to convert float to string **
// // case float64:
// // value, _ = strconv.ParseFloat(v.(string), 64)
// case string:
// value = ("'" + v.(string) + "'")
// default:
// value = ""
// }
// if len(value) > 0 {
// propParts = append(propParts, key+": "+value)
// }
// }
// // construct our cypher
// result = "(" + alias + ":" + label + " { " + joinUsing(propParts, ", ") + " })"
// return
// }