diff --git a/internal/module/midi-output.go b/internal/module/midi-output.go index 242521d..35ec41d 100644 --- a/internal/module/midi-output.go +++ b/internal/module/midi-output.go @@ -87,7 +87,7 @@ func (mo *MIDIOutput) Output(ctx context.Context, payload any) error { payloadMessage, ok := common.GetAnyAs[midi.Message](payload) if !ok { - return errors.New("midi.output can only ouptut midi.Message") + return errors.New("midi.output can only output midi.Message") } return mo.SendFunc(payloadMessage) diff --git a/internal/module/serial-client.go b/internal/module/serial-client.go index 6eb37be..ab3b84b 100644 --- a/internal/module/serial-client.go +++ b/internal/module/serial-client.go @@ -156,10 +156,10 @@ func (sc *SerialClient) Start(ctx context.Context) error { func (sc *SerialClient) Output(ctx context.Context, payload any) error { - payloadBytes, ok := common.GetAnyAs[[]byte](payload) + payloadBytes, ok := common.GetAnyAsByteSlice(payload) if !ok { - return errors.New("serial.client can only ouptut bytes") + return errors.New("serial.client can only output bytes") } _, err := sc.port.Write(sc.Framer.Encode(payloadBytes)) diff --git a/internal/module/tcp-client.go b/internal/module/tcp-client.go index 03c5e0e..6421248 100644 --- a/internal/module/tcp-client.go +++ b/internal/module/tcp-client.go @@ -152,7 +152,7 @@ func (tc *TCPClient) Output(ctx context.Context, payload any) error { return err } } - payloadBytes, ok := common.GetAnyAs[[]byte](payload) + payloadBytes, ok := common.GetAnyAsByteSlice(payload) if !ok { return errors.New("net.tcp.client is only able to output bytes") } diff --git a/internal/module/tcp-server.go b/internal/module/tcp-server.go index 362df96..2e1e1db 100644 --- a/internal/module/tcp-server.go +++ b/internal/module/tcp-server.go @@ -206,7 +206,7 @@ AcceptLoop: } func (ts *TCPServer) Output(ctx context.Context, payload any) error { - payloadBytes, ok := common.GetAnyAs[[]byte](payload) + payloadBytes, ok := common.GetAnyAsByteSlice(payload) if !ok { return errors.New("net.tcp.server is only able to output bytes") diff --git a/internal/module/udp-client.go b/internal/module/udp-client.go index 99f75be..6fd7185 100644 --- a/internal/module/udp-client.go +++ b/internal/module/udp-client.go @@ -87,7 +87,7 @@ func (uc *UDPClient) Start(ctx context.Context) error { func (uc *UDPClient) Output(ctx context.Context, payload any) error { - payloadBytes, ok := common.GetAnyAs[[]byte](payload) + payloadBytes, ok := common.GetAnyAsByteSlice(payload) if !ok { return errors.New("net.udp.client is only able to output bytes") } diff --git a/internal/module/udp-multicast.go b/internal/module/udp-multicast.go index 11d0845..2aa703b 100644 --- a/internal/module/udp-multicast.go +++ b/internal/module/udp-multicast.go @@ -108,7 +108,7 @@ func (um *UDPMulticast) Start(ctx context.Context) error { func (um *UDPMulticast) Output(ctx context.Context, payload any) error { - payloadBytes, ok := common.GetAnyAs[[]byte](payload) + payloadBytes, ok := common.GetAnyAsByteSlice(payload) if !ok { return errors.New("net.udp.multicast can only output bytes") } diff --git a/internal/processor/artnet-packet-decode.go b/internal/processor/artnet-packet-decode.go index 9fed8ac..b15990d 100644 --- a/internal/processor/artnet-packet-decode.go +++ b/internal/processor/artnet-packet-decode.go @@ -15,7 +15,7 @@ type ArtNetPacketDecode struct { func (apd *ArtNetPacketDecode) Process(ctx context.Context, wrappedPayload common.WrappedPayload) (common.WrappedPayload, error) { payload := wrappedPayload.Payload - payloadBytes, ok := common.GetAnyAs[[]byte](payload) + payloadBytes, ok := common.GetAnyAsByteSlice(payload) if !ok { wrappedPayload.End = true diff --git a/internal/processor/free-d-decode.go b/internal/processor/free-d-decode.go index 6f87b9a..5c4d8b1 100644 --- a/internal/processor/free-d-decode.go +++ b/internal/processor/free-d-decode.go @@ -15,7 +15,7 @@ type FreeDDecode struct { func (fd *FreeDDecode) Process(ctx context.Context, wrappedPayload common.WrappedPayload) (common.WrappedPayload, error) { payload := wrappedPayload.Payload - payloadBytes, ok := common.GetAnyAs[[]byte](payload) + payloadBytes, ok := common.GetAnyAsByteSlice(payload) if !ok { wrappedPayload.End = true diff --git a/internal/processor/midi-message-decode.go b/internal/processor/midi-message-decode.go index d387fb3..fbbd546 100644 --- a/internal/processor/midi-message-decode.go +++ b/internal/processor/midi-message-decode.go @@ -17,7 +17,7 @@ type MIDIMessageDecode struct { func (mmd *MIDIMessageDecode) Process(ctx context.Context, wrappedPayload common.WrappedPayload) (common.WrappedPayload, error) { payload := wrappedPayload.Payload - payloadBytes, ok := common.GetAnyAs[[]byte](payload) + payloadBytes, ok := common.GetAnyAsByteSlice(payload) if !ok { wrappedPayload.End = true diff --git a/internal/processor/osc-message-decode.go b/internal/processor/osc-message-decode.go index f1cb4e3..f41e8da 100644 --- a/internal/processor/osc-message-decode.go +++ b/internal/processor/osc-message-decode.go @@ -16,7 +16,7 @@ type OSCMessageDecode struct { func (omd *OSCMessageDecode) Process(ctx context.Context, wrappedPayload common.WrappedPayload) (common.WrappedPayload, error) { payload := wrappedPayload.Payload - payloadBytes, ok := common.GetAnyAs[[]byte](payload) + payloadBytes, ok := common.GetAnyAsByteSlice(payload) if !ok { wrappedPayload.End = true diff --git a/internal/processor/script-wasm.go b/internal/processor/script-wasm.go index d87d129..4bf48c0 100644 --- a/internal/processor/script-wasm.go +++ b/internal/processor/script-wasm.go @@ -19,7 +19,7 @@ type ScriptWASM struct { func (sw *ScriptWASM) Process(ctx context.Context, wrappedPayload common.WrappedPayload) (common.WrappedPayload, error) { payload := wrappedPayload.Payload - payloadBytes, ok := common.GetAnyAs[[]byte](payload) + payloadBytes, ok := common.GetAnyAsByteSlice(payload) if !ok { wrappedPayload.End = true diff --git a/internal/processor/string-decode.go b/internal/processor/string-decode.go index 66827d3..79bac96 100644 --- a/internal/processor/string-decode.go +++ b/internal/processor/string-decode.go @@ -14,7 +14,7 @@ type StringDecode struct { func (sd *StringDecode) Process(ctx context.Context, wrappedPayload common.WrappedPayload) (common.WrappedPayload, error) { payload := wrappedPayload.Payload - payloadBytes, ok := common.GetAnyAs[[]byte](payload) + payloadBytes, ok := common.GetAnyAsByteSlice(payload) if !ok { wrappedPayload.End = true diff --git a/internal/route/route_test.go b/internal/route/route_test.go index 7705f89..bad055e 100644 --- a/internal/route/route_test.go +++ b/internal/route/route_test.go @@ -60,7 +60,7 @@ func TestGoodRouteHandleInput(t *testing.T) { t.Fatalf("route ProcessPayload returned error: %v", err) } - payloadBytes, ok := common.GetAnyAs[[]byte](payload) + payloadBytes, ok := common.GetAnyAsByteSlice(payload) if !ok { t.Fatalf("payload should be []byte got %T", payload) }