fixed string_suffixreplace
parent
94b5999756
commit
8bf8e5d60a
|
@ -241,11 +241,10 @@ func MakeSuffixReplace(fieldName string, fieldType FieldType, field Field) (Make
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, errors.New("missing suffixes in args for string_suffixreplace")
|
return nil, errors.New("missing suffixes in args for string_suffixreplace")
|
||||||
}
|
}
|
||||||
fmt.Printf("%#v\n", _changes)
|
|
||||||
|
|
||||||
changes, ok := _changes.(map[string]string)
|
changes, ok := _changes.(map[string]interface{})
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, errors.New("suffixes in args for string_suffixreplace not a list")
|
return nil, errors.New("suffixes in args for string_suffixreplace not a dict")
|
||||||
}
|
}
|
||||||
|
|
||||||
var suffixes []string
|
var suffixes []string
|
||||||
|
@ -256,7 +255,7 @@ func MakeSuffixReplace(fieldName string, fieldType FieldType, field Field) (Make
|
||||||
re := regexp.MustCompile(reStr)
|
re := regexp.MustCompile(reStr)
|
||||||
|
|
||||||
replFunc := func(match string) string {
|
replFunc := func(match string) string {
|
||||||
return changes[match]
|
return changes[match].(string)
|
||||||
}
|
}
|
||||||
|
|
||||||
suffixReplace := func(val string, elem *element.OSMElem, match Match) interface{} {
|
suffixReplace := func(val string, elem *element.OSMElem, match Match) interface{} {
|
||||||
|
|
Loading…
Reference in New Issue