Fix lint errors

This commit is contained in:
世界 2026-07-16 18:45:49 +08:00
parent 994d6ccdbf
commit d1af8aaf7e
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
6 changed files with 15 additions and 21 deletions

View file

@ -24,7 +24,6 @@ import (
"time"
"github.com/sagernet/sing-tun/gtcpip"
"github.com/sagernet/sing/common"
)
// ndpOptionIdentifier is an NDP option type identifier.
@ -341,7 +340,7 @@ func (b NDPOptions) Serialize(s NDPOptionsSerializer) int {
// Zero out remaining (padding) bytes, if any exists.
if used+2 < l {
common.ClearArray(b[used+2 : l])
clear(b[used+2 : l])
}
b = b[l:]
@ -567,7 +566,7 @@ func (o NDPPrefixInformation) serializeInto(b []byte) int {
// Zero out the Reserved2 field.
reserved2 := b[ndpPrefixInformationReserved2Offset:][:ndpPrefixInformationReserved2Length]
common.ClearArray(reserved2)
clear(reserved2)
return used
}
@ -686,7 +685,7 @@ func (o NDPRecursiveDNSServer) serializeInto(b []byte) int {
used := copy(b, o)
// Zero out the reserved bytes that are before the Lifetime field.
common.ClearArray(b[0:ndpRecursiveDNSServerLifetimeOffset])
clear(b[0:ndpRecursiveDNSServerLifetimeOffset])
return used
}
@ -779,7 +778,7 @@ func (o NDPDNSSearchList) serializeInto(b []byte) int {
used := copy(b, o)
// Zero out the reserved bytes that are before the Lifetime field.
common.ClearArray(b[0:ndpDNSSearchListLifetimeOffset])
clear(b[0:ndpDNSSearchListLifetimeOffset])
return used
}