fix lint issues before merge

This commit is contained in:
ZacharyZcR
2026-05-18 17:59:00 +08:00
parent 5942d3bbcb
commit 5a884ca6ad
7 changed files with 17 additions and 13 deletions
+1 -1
View File
@@ -229,7 +229,7 @@ func (p *ActiveMQPlugin) identifyService(ctx context.Context, info *common.HostI
return &ScanResult{
Success: false,
Service: "activemq",
Error: fmt.Errorf("Failed to read response: %w", err),
Error: fmt.Errorf("failed to read response: %w", err),
}
}
if n == 0 {
+3 -2
View File
@@ -169,9 +169,10 @@ var cqlStreamID int16
func cqlSend(conn net.Conn, opcode byte, body []byte) error {
id := cqlStreamID
cqlStreamID++
if cqlStreamID > 32767 {
if cqlStreamID == 32767 {
cqlStreamID = 0
} else {
cqlStreamID++
}
// frame: [1B version|flags] [2B stream] [1B opcode] [4B length] [body]
-1
View File
@@ -323,7 +323,6 @@ func mssqlParseLoginTokens(payload []byte, result *mssqlRawResult) (bool, error)
return false, fmt.Errorf("mssql: truncated done token")
}
status := binary.LittleEndian.Uint16(payload[pos : pos+2])
pos += 12
return status&(tdsDoneError|tdsDoneSrvError) == 0, nil
default:
return false, fmt.Errorf("mssql: unexpected login token 0x%02x", token)
+7 -3
View File
@@ -341,8 +341,13 @@ func (s *oracleSession) putString(v string) {
func (s *oracleSession) putInt(v interface{}, size uint8, bigEndian, compress bool) {
num := toInt64(v)
if compress {
neg := num < 0
encoded := uint64(num)
if neg {
encoded = uint64(-(num + 1)) + 1
}
temp := make([]byte, 8)
binary.BigEndian.PutUint64(temp, uint64(num))
binary.BigEndian.PutUint64(temp, encoded)
temp = bytes.TrimLeft(temp, "\x00")
if size > uint8(len(temp)) {
size = uint8(len(temp))
@@ -351,8 +356,7 @@ func (s *oracleSession) putInt(v interface{}, size uint8, bigEndian, compress bo
s.out.WriteByte(0)
return
}
if num < 0 {
num = -num
if neg {
size |= 0x80
}
s.out.WriteByte(size)