mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-08-17 12:23:22 +00:00
cleanup some error handling lint issues
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user