Fix more golangci-lint issues

This commit is contained in:
bad 2021-10-17 21:09:44 +02:00
parent 9cd116c5e4
commit 807ea96d67
4 changed files with 62 additions and 62 deletions

View file

@ -12,27 +12,27 @@ type ConnectReasonCode byte
const (
ConnectReasonCodeSuccess ConnectReasonCode = 0
ConnectReasonCodeUnspecified = 128
ConnectReasonCodeMalformedPacket = 129
ConnectReasonCodeProtocolError = 130
ConnectReasonCodeImplErorr = 131
ConnectReasonCodeUnsupportedProtoVer = 132
ConnectReasonCodeClientIDNotValid = 133
ConnectReasonCodeBadUsernameOrPassword = 134
ConnectReasonCodeNotAuthorized = 135
ConnectReasonCodeServerUnavaliable = 136
ConnectReasonCodeServerBusy = 137
ConnectReasonCodeBanned = 138
ConnectReasonCodeBadAuthenticationMethod = 140
ConnectReasonCodeTopicNameInvalid = 144
ConnectReasonCodePacketTooLarge = 149
ConnectReasonCodeQuotaExceeded = 151
ConnectReasonCodePayloadFormatInvalid = 153
ConnectReasonCodeRetainNotSupported = 154
ConnectReasonCodeQoSNotSupported = 155
ConnectReasonCodeUseAnotherServer = 156
ConnectReasonCodeServerMoved = 157
ConnectReasonCodeConnectionRateExceeded = 159
ConnectReasonCodeUnspecified ConnectReasonCode = 128
ConnectReasonCodeMalformedPacket ConnectReasonCode = 129
ConnectReasonCodeProtocolError ConnectReasonCode = 130
ConnectReasonCodeImplErorr ConnectReasonCode = 131
ConnectReasonCodeUnsupportedProtoVer ConnectReasonCode = 132
ConnectReasonCodeClientIDNotValid ConnectReasonCode = 133
ConnectReasonCodeBadUsernameOrPassword ConnectReasonCode = 134
ConnectReasonCodeNotAuthorized ConnectReasonCode = 135
ConnectReasonCodeServerUnavaliable ConnectReasonCode = 136
ConnectReasonCodeServerBusy ConnectReasonCode = 137
ConnectReasonCodeBanned ConnectReasonCode = 138
ConnectReasonCodeBadAuthenticationMethod ConnectReasonCode = 140
ConnectReasonCodeTopicNameInvalid ConnectReasonCode = 144
ConnectReasonCodePacketTooLarge ConnectReasonCode = 149
ConnectReasonCodeQuotaExceeded ConnectReasonCode = 151
ConnectReasonCodePayloadFormatInvalid ConnectReasonCode = 153
ConnectReasonCodeRetainNotSupported ConnectReasonCode = 154
ConnectReasonCodeQoSNotSupported ConnectReasonCode = 155
ConnectReasonCodeUseAnotherServer ConnectReasonCode = 156
ConnectReasonCodeServerMoved ConnectReasonCode = 157
ConnectReasonCodeConnectionRateExceeded ConnectReasonCode = 159
)
type ConnackPacket struct {

View file

@ -9,14 +9,14 @@ type PubackReasonCode byte
const (
PubackReasonCodeSuccess PubackReasonCode = 0
PubackReasonCodeNoMatchingSubscribers = 16
PubackReasonCodeUnspecifiedError = 128
PubackReasonCodeImplementationSpecyficEror = 131
PubackReasonCodeNotAuthorized = 135
PubackReasonCodeTopicNameInvalid = 144
PubackReasonCodePacketIDInUse = 145
PubackReasonCodeQuotaExceeded = 151
PubackReasonCodePayloadFormatInvalid = 153
PubackReasonCodeNoMatchingSubscribers PubackReasonCode = 16
PubackReasonCodeUnspecifiedError PubackReasonCode = 128
PubackReasonCodeImplementationSpecyficEror PubackReasonCode = 131
PubackReasonCodeNotAuthorized PubackReasonCode = 135
PubackReasonCodeTopicNameInvalid PubackReasonCode = 144
PubackReasonCodePacketIDInUse PubackReasonCode = 145
PubackReasonCodeQuotaExceeded PubackReasonCode = 151
PubackReasonCodePayloadFormatInvalid PubackReasonCode = 153
)
type PubackPacket struct {
@ -55,7 +55,7 @@ type PubrelReasonCode byte
const (
PubrelReasonCodeSuccess PubackReasonCode = 0
PubrelReasonPacketIDNotFound = 146
PubrelReasonPacketIDNotFound PubackReasonCode = 146
)
type PubrelPacket struct {

View file

@ -118,18 +118,18 @@ func (p SubscribePacket) Visit(v PacketVisitor) {
type SubackReasonCode byte
const (
SubackReasonGrantedQoSZero PubackReasonCode = 0
SubackReasonGrantedQoSOne = 1
SubackReasonGrantedQoSTwo = 2
SubackReasonUnspecified = 128
SubackReasonImplSpecificError = 131
SubackReasonNotAuthorized = 135
SubackReasonTopicFilterInvalid = 143
SubackReasonPacketIDInUse = 145
SubackReasonQuotaExceeded = 151
SubackReasonSharedSubNotSupported = 158
SubackReasonSubIDUnsupported = 161
SubackReasonWildcardSubUnsupported = 162
SubackReasonGrantedQoSZero SubackReasonCode = 0
SubackReasonGrantedQoSOne SubackReasonCode = 1
SubackReasonGrantedQoSTwo SubackReasonCode = 2
SubackReasonUnspecified SubackReasonCode = 128
SubackReasonImplSpecificError SubackReasonCode = 131
SubackReasonNotAuthorized SubackReasonCode = 135
SubackReasonTopicFilterInvalid SubackReasonCode = 143
SubackReasonPacketIDInUse SubackReasonCode = 145
SubackReasonQuotaExceeded SubackReasonCode = 151
SubackReasonSharedSubNotSupported SubackReasonCode = 158
SubackReasonSubIDUnsupported SubackReasonCode = 161
SubackReasonWildcardSubUnsupported SubackReasonCode = 162
)
type SubAckPacket struct {
@ -219,11 +219,11 @@ type UnsubackReasonCode byte
const (
UnsubackReasonSuccess UnsubackReasonCode = 0
UnSubackReasonUnspecified = 128
UnSubackReasonImplSpecificError = 131
UnSubackReasonNotAuthorized = 135
UnSubackReasonTopicFilterInvalid = 143
UnSubackReasonPacketIDInUse = 145
UnSubackReasonUnspecified UnsubackReasonCode = 128
UnSubackReasonImplSpecificError UnsubackReasonCode = 131
UnSubackReasonNotAuthorized UnsubackReasonCode = 135
UnSubackReasonTopicFilterInvalid UnsubackReasonCode = 143
UnSubackReasonPacketIDInUse UnsubackReasonCode = 145
)
type UnsubAckPacket struct {

View file

@ -33,21 +33,21 @@ type PacketType byte
const (
PacketTypeReserved PacketType = 0 // Forbidden
PacketTypeConnect = 1
PacketTypeConnack = 2
PacketTypePublish = 3
PacketTypePuback = 4
PacketTypePubrec = 5
PacketTypePubrel = 6
PacketTypePubcomp = 7
PacketTypeSubscribe = 8
PacketTypeSuback = 9
PacketTypeUnsubscribe = 10
PacketTypeUnsuback = 11
PacketTypePingreq = 12
PacketTypePingresp = 13
PacketTypeDisconnect = 14
PacketTypeAuth = 15
PacketTypeConnect PacketType = 1
PacketTypeConnack PacketType = 2
PacketTypePublish PacketType = 3
PacketTypePuback PacketType = 4
PacketTypePubrec PacketType = 5
PacketTypePubrel PacketType = 6
PacketTypePubcomp PacketType = 7
PacketTypeSubscribe PacketType = 8
PacketTypeSuback PacketType = 9
PacketTypeUnsubscribe PacketType = 10
PacketTypeUnsuback PacketType = 11
PacketTypePingreq PacketType = 12
PacketTypePingresp PacketType = 13
PacketTypeDisconnect PacketType = 14
PacketTypeAuth PacketType = 15
)
func ReadPacket(r *bufio.Reader) (*ClientPacket, error) {