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

@ -1,11 +1,10 @@
package ping
import (
"encoding/binary"
"fmt"
"unsafe"
"github.com/sagernet/sing/common"
"golang.org/x/net/ipv6"
"golang.org/x/sys/windows"
)
@ -37,9 +36,9 @@ func parseIPv6ControlMessage(cmsg []byte) (*ipv6.ControlMessage, error) {
}
switch cmsghdr.Type {
case IPV6_TCLASS:
controlMessage.TrafficClass = int(common.NativeEndian.Uint32(cmsg[alignedSizeofCmsghdr : alignedSizeofCmsghdr+4]))
controlMessage.TrafficClass = int(binary.NativeEndian.Uint32(cmsg[alignedSizeofCmsghdr : alignedSizeofCmsghdr+4]))
case IPV6_HOPLIMIT:
controlMessage.HopLimit = int(common.NativeEndian.Uint32(cmsg[alignedSizeofCmsghdr : alignedSizeofCmsghdr+4]))
controlMessage.HopLimit = int(binary.NativeEndian.Uint32(cmsg[alignedSizeofCmsghdr : alignedSizeofCmsghdr+4]))
}
cmsg = cmsg[msgSize:]
}

View file

@ -9,7 +9,6 @@ import (
"time"
"github.com/sagernet/sing-tun/gtcpip/header"
"github.com/sagernet/sing/common"
"github.com/sagernet/sing/common/buf"
"github.com/sagernet/sing/common/control"
M "github.com/sagernet/sing/common/metadata"
@ -175,7 +174,7 @@ func (c *UnprivilegedConn) Close() error {
for _, conn := range c.mapping {
_ = conn.Close()
}
common.ClearMap(c.mapping)
clear(c.mapping)
return nil
}