cleanup some error handling lint issues

This commit is contained in:
Joel Wetzell
2026-05-17 09:48:49 -05:00
parent 8752b35ea4
commit b4d4ef3421
8 changed files with 77 additions and 4 deletions
@@ -34,6 +34,11 @@ func (mpcc *MIDIProgramChangeCreate) Process(ctx context.Context, wrappedPayload
channelValue, err := strconv.ParseUint(channelBuffer.String(), 10, 8)
if err != nil {
wrappedPayload.End = true
return wrappedPayload, err
}
var programBuffer bytes.Buffer
err = mpcc.Program.Execute(&programBuffer, templateData)
@@ -44,6 +49,11 @@ func (mpcc *MIDIProgramChangeCreate) Process(ctx context.Context, wrappedPayload
programValue, err := strconv.ParseUint(programBuffer.String(), 10, 8)
if err != nil {
wrappedPayload.End = true
return wrappedPayload, err
}
payloadMessage := midi.ProgramChange(uint8(channelValue), uint8(programValue))
wrappedPayload.Payload = payloadMessage
return wrappedPayload, nil