mirror of
https://github.com/SagerNet/sing-box.git
synced 2026-04-11 17:47:20 +10:00
Fix lint errors
This commit is contained in:
@@ -37,7 +37,7 @@ func NewHTTP3MeasurementClientFactory(dialer N.Dialer) (MeasurementClientFactory
|
|||||||
if dialErr != nil {
|
if dialErr != nil {
|
||||||
return nil, dialErr
|
return nil, dialErr
|
||||||
}
|
}
|
||||||
var wrappedConn net.Conn = udpConn
|
wrappedConn := udpConn
|
||||||
if len(readCounters) > 0 || len(writeCounters) > 0 {
|
if len(readCounters) > 0 || len(writeCounters) > 0 {
|
||||||
wrappedConn = sBufio.NewCounterConn(udpConn, readCounters, writeCounters)
|
wrappedConn = sBufio.NewCounterConn(udpConn, readCounters, writeCounters)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,8 @@ func writeAlloc(w io.Writer) error {
|
|||||||
|
|
||||||
func writeHeapInternal(w io.Writer, defaultSampleType string) error {
|
func writeHeapInternal(w io.Writer, defaultSampleType string) error {
|
||||||
var profile []memProfileRecord
|
var profile []memProfileRecord
|
||||||
n, ok := runtimeMemProfileInternal(nil, true)
|
n, _ := runtimeMemProfileInternal(nil, true)
|
||||||
|
var ok bool
|
||||||
for {
|
for {
|
||||||
profile = make([]memProfileRecord, n+50)
|
profile = make([]memProfileRecord, n+50)
|
||||||
n, ok = runtimeMemProfileInternal(profile, true)
|
n, ok = runtimeMemProfileInternal(profile, true)
|
||||||
@@ -121,7 +122,8 @@ func writeRuntimeProfile(w io.Writer, name string, fetch func([]stackRecord, []u
|
|||||||
var profile []stackRecord
|
var profile []stackRecord
|
||||||
var labels []unsafe.Pointer
|
var labels []unsafe.Pointer
|
||||||
|
|
||||||
n, ok := fetch(nil, nil)
|
n, _ := fetch(nil, nil)
|
||||||
|
var ok bool
|
||||||
for {
|
for {
|
||||||
profile = make([]stackRecord, n+10)
|
profile = make([]stackRecord, n+10)
|
||||||
labels = make([]unsafe.Pointer, n+10)
|
labels = make([]unsafe.Pointer, n+10)
|
||||||
@@ -146,7 +148,8 @@ func writeMutex(w io.Writer) error {
|
|||||||
|
|
||||||
func writeCycleProfile(w io.Writer, countName string, cycleName string, fetch func([]blockProfileRecord) (int, bool)) error {
|
func writeCycleProfile(w io.Writer, countName string, cycleName string, fetch func([]blockProfileRecord) (int, bool)) error {
|
||||||
var profile []blockProfileRecord
|
var profile []blockProfileRecord
|
||||||
n, ok := fetch(nil)
|
n, _ := fetch(nil)
|
||||||
|
var ok bool
|
||||||
for {
|
for {
|
||||||
profile = make([]blockProfileRecord, n+50)
|
profile = make([]blockProfileRecord, n+50)
|
||||||
n, ok = fetch(profile)
|
n, ok = fetch(profile)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ func (b *protobuf) length(tag int, length int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (b *protobuf) uint64(tag int, x uint64) {
|
func (b *protobuf) uint64(tag int, x uint64) {
|
||||||
b.varint(uint64(tag)<<3 | 0)
|
b.varint(uint64(tag) << 3)
|
||||||
b.varint(x)
|
b.varint(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user