mirror of
https://github.com/netsampler/goflow2.git
synced 2024-05-06 15:54:52 +00:00
format: fix renderer (#250)
This commit is contained in:
@ -186,7 +186,10 @@ func FormatMessageReflectCustom(msg interface{}, ext, quotes, sep, sign string,
|
|||||||
}
|
}
|
||||||
fieldValue := vfm.FieldByName(fieldName)
|
fieldValue := vfm.FieldByName(fieldName)
|
||||||
// todo: replace s by json mapping of protobuf
|
// todo: replace s by json mapping of protobuf
|
||||||
if fieldValue.IsValid() {
|
if renderer, ok := RenderExtras[fieldName]; ok {
|
||||||
|
fstr[i] = fmt.Sprintf("%s%s%s%s%q", quotes, s, quotes, sign, renderer(msg))
|
||||||
|
i++
|
||||||
|
} else if fieldValue.IsValid() {
|
||||||
|
|
||||||
if fieldType, ok := TextFields[fieldName]; ok {
|
if fieldType, ok := TextFields[fieldName]; ok {
|
||||||
switch fieldType {
|
switch fieldType {
|
||||||
@ -213,8 +216,6 @@ func FormatMessageReflectCustom(msg interface{}, ext, quotes, sep, sign string,
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if renderer, ok := RenderExtras[fieldName]; ok {
|
|
||||||
fstr[i] = fmt.Sprintf("%s%s%s%s%q", quotes, s, quotes, sign, renderer(msg))
|
|
||||||
} else {
|
} else {
|
||||||
// handle specific types here
|
// handle specific types here
|
||||||
switch fieldValue.Kind() {
|
switch fieldValue.Kind() {
|
||||||
|
Reference in New Issue
Block a user