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
@@ -35,6 +35,11 @@ func (mccc *MIDIControlChangeCreate) Process(ctx context.Context, wrappedPayload
channelValue, err := strconv.ParseUint(channelBuffer.String(), 10, 8)
if err != nil {
wrappedPayload.End = true
return wrappedPayload, err
}
var controlBuffer bytes.Buffer
err = mccc.Control.Execute(&controlBuffer, templateData)
@@ -45,6 +50,11 @@ func (mccc *MIDIControlChangeCreate) Process(ctx context.Context, wrappedPayload
controlValue, err := strconv.ParseUint(controlBuffer.String(), 10, 8)
if err != nil {
wrappedPayload.End = true
return wrappedPayload, err
}
var valueBuffer bytes.Buffer
err = mccc.Value.Execute(&valueBuffer, templateData)
@@ -55,6 +65,11 @@ func (mccc *MIDIControlChangeCreate) Process(ctx context.Context, wrappedPayload
valueValue, err := strconv.ParseUint(valueBuffer.String(), 10, 8)
if err != nil {
wrappedPayload.End = true
return wrappedPayload, err
}
payloadMessage := midi.ControlChange(uint8(channelValue), uint8(controlValue), uint8(valueValue))
wrappedPayload.Payload = payloadMessage
return wrappedPayload, nil