1234567891011121314 |
- package bar
- import "github.com/hypebeast/go-osc/osc"
- // Generic function to get message argument of given type
- func getOSC[T any](msg *osc.Message) T {
- var zero T
- for _, arg := range msg.Arguments {
- if _, isType := arg.(T); isType {
- return arg.(T)
- }
- }
- return zero
- }
|