Go

Go

Made by DeepSource

Only the first constant has an explicit type SCC-SA9004

Anti-pattern
Major
Autofix

Every constant in a constant declaration block needs to have a type unless the iota construct is used

Bad practice

const (
    First byte = 1
    Second     = 2
)

the constant Second does not have the same type as First.

Recommended

const (
    First  byte = 1
    Second byte = 2
)

However, for iota declarations, the following would work

const (
    First byte = iota
    Second
)