Fix lint errors

This commit is contained in:
世界
2026-04-10 12:10:02 +08:00
parent 97f4723467
commit 6da0aa0c82
3 changed files with 8 additions and 5 deletions

View File

@@ -37,7 +37,7 @@ func NewHTTP3MeasurementClientFactory(dialer N.Dialer) (MeasurementClientFactory
if dialErr != nil {
return nil, dialErr
}
var wrappedConn net.Conn = udpConn
wrappedConn := udpConn
if len(readCounters) > 0 || len(writeCounters) > 0 {
wrappedConn = sBufio.NewCounterConn(udpConn, readCounters, writeCounters)
}

View File

@@ -95,7 +95,8 @@ func writeAlloc(w io.Writer) error {
func writeHeapInternal(w io.Writer, defaultSampleType string) error {
var profile []memProfileRecord
n, ok := runtimeMemProfileInternal(nil, true)
n, _ := runtimeMemProfileInternal(nil, true)
var ok bool
for {
profile = make([]memProfileRecord, n+50)
n, ok = runtimeMemProfileInternal(profile, true)
@@ -121,7 +122,8 @@ func writeRuntimeProfile(w io.Writer, name string, fetch func([]stackRecord, []u
var profile []stackRecord
var labels []unsafe.Pointer
n, ok := fetch(nil, nil)
n, _ := fetch(nil, nil)
var ok bool
for {
profile = make([]stackRecord, 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 {
var profile []blockProfileRecord
n, ok := fetch(nil)
n, _ := fetch(nil)
var ok bool
for {
profile = make([]blockProfileRecord, n+50)
n, ok = fetch(profile)

View File

@@ -22,7 +22,7 @@ func (b *protobuf) length(tag int, length int) {
}
func (b *protobuf) uint64(tag int, x uint64) {
b.varint(uint64(tag)<<3 | 0)
b.varint(uint64(tag) << 3)
b.varint(x)
}