goflow icon indicating copy to clipboard operation
goflow copied to clipboard

Why do we choose []byte as the type of workload func's param/output, not interface{}

Open jasonliu119 opened this issue 1 year ago • 2 comments

IIUC, the workload function is like:

func doSomething(data []byte, option map[string][]string) ([]byte, error) 

Why do we choose []byte as the type of its param/output, not interface{} or Golang any?

jasonliu119 avatar Feb 23 '24 06:02 jasonliu119

Also, maybe option can be a param of type map[string]interface{}

jasonliu119 avatar Feb 23 '24 06:02 jasonliu119

I think it was mostly to avoid serialization issue.

s8sg avatar Apr 02 '24 16:04 s8sg