some linting things

This commit is contained in:
Joel Wetzell
2026-05-17 09:22:14 -05:00
parent d6d4ac4419
commit 6aadaedb5d
5 changed files with 16 additions and 15 deletions
+4 -6
View File
@@ -141,11 +141,12 @@ func slipEncode(bytes []byte) []byte {
var encodedBytes = []byte{END}
for _, byteToEncode := range bytes {
if byteToEncode == END {
switch byteToEncode {
case END:
encodedBytes = append(encodedBytes, ESC, ESC_END)
} else if byteToEncode == ESC {
case ESC:
encodedBytes = append(encodedBytes, ESC, ESC_ESC)
} else {
default:
encodedBytes = append(encodedBytes, byteToEncode)
}
}
@@ -178,8 +179,5 @@ func makeMsg(address string, args []string, types []string, slip bool) {
if slip {
oscMessageBuffer = slipEncode(oscMessageBuffer)
}
//TODO write buffer to stdout
os.Stdout.Write(oscMessageBuffer)
}
+3 -2
View File
@@ -120,9 +120,10 @@ func (s *SLIP) decode(bytes []byte) {
}
if escapeNext {
if packetByte == ESC_END {
switch packetByte {
case ESC_END:
s.pendingBytes = append(s.pendingBytes, END)
} else if packetByte == ESC_ESC {
case ESC_ESC:
s.pendingBytes = append(s.pendingBytes, ESC)
}
escapeNext = false
+4 -3
View File
@@ -169,11 +169,12 @@ func slipEncode(bytes []byte) []byte {
var encodedBytes = []byte{END}
for _, byteToEncode := range bytes {
if byteToEncode == END {
switch byteToEncode {
case END:
encodedBytes = append(encodedBytes, ESC, ESC_END)
} else if byteToEncode == ESC {
case ESC:
encodedBytes = append(encodedBytes, ESC, ESC_ESC)
} else {
default:
encodedBytes = append(encodedBytes, byteToEncode)
}
}