fixed string_suffixreplace

master
Oliver Tonnhofer 2013-06-28 13:10:04 +02:00
parent 94b5999756
commit 8bf8e5d60a
1 changed files with 3 additions and 4 deletions

View File

@ -241,11 +241,10 @@ func MakeSuffixReplace(fieldName string, fieldType FieldType, field Field) (Make
if !ok {
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 {
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
@ -256,7 +255,7 @@ func MakeSuffixReplace(fieldName string, fieldType FieldType, field Field) (Make
re := regexp.MustCompile(reStr)
replFunc := func(match string) string {
return changes[match]
return changes[match].(string)
}
suffixReplace := func(val string, elem *element.OSMElem, match Match) interface{} {