style(scanner): tagged switch on ID3 major version — #2499
test-go / test (push) Successful in 55s
test-go / integration (push) Successful in 4m55s

This commit is contained in:
2026-08-05 21:22:53 -04:00
parent 37b396a7e4
commit fd27819cdd
+3 -3
View File
@@ -141,10 +141,10 @@ func findGenreFrame(body []byte, major byte) ([]string, error) {
// the reverse) yields a plausible-looking wrong offset rather than an obvious
// error, which is exactly how frame-walking bugs go unnoticed.
func frameSize(b []byte, major byte) int {
switch {
case major == 2:
switch major {
case 2:
return int(b[0])<<16 | int(b[1])<<8 | int(b[2])
case major == 3:
case 3:
n := binary.BigEndian.Uint32(b)
if n > maxID3TagSize {
return -1