mirror of
https://github.com/hanzoai/visor.git
synced 2026-09-24 17:04:14 +00:00
Fix S1030 violations and drop suppression
This commit is contained in:
@@ -239,10 +239,6 @@ analyzers:
|
||||
# See above.
|
||||
- "symbol \"runtime_pollWaitCanceled\".*"
|
||||
- "symbol \"runtime_procPin\".*"
|
||||
S1030: # Use `bytes.Buffer.String` or `bytes.Buffer.Bytes`
|
||||
# disabled for now due to existing violations.
|
||||
internal:
|
||||
exclude: [".*"]
|
||||
S1033: # Remove unnecessary guard around delete
|
||||
# disabled for now due to existing violations.
|
||||
internal:
|
||||
|
||||
@@ -193,7 +193,7 @@ func TestBlockSeqIterBytes(t *testing.T) {
|
||||
}
|
||||
srcs = nextSrcs
|
||||
}
|
||||
if got := string(dst.Bytes()); got != test.want {
|
||||
if got := dst.String(); got != test.want {
|
||||
t.Errorf("Copied string: got %q, wanted %q", got, test.want)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -109,5 +109,5 @@ func (c *Agent) String() string {
|
||||
// c.buf.Bytes(), which may be modified after c.mu.Unlock(). If you change
|
||||
// this function to return []byte for some reason, c.buf.Bytes() needs to
|
||||
// be cloned instead.
|
||||
return string(c.buf.Bytes())
|
||||
return c.buf.String()
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ func (mm *MemoryManager) DebugString(ctx context.Context) string {
|
||||
b.Write(pseg.debugStringEntryLocked())
|
||||
}
|
||||
|
||||
return string(b.Bytes())
|
||||
return b.String()
|
||||
}
|
||||
|
||||
// Preconditions: mm.activeMu must be locked.
|
||||
|
||||
@@ -37,7 +37,7 @@ func TestCreateTaskRequest(t *testing.T) {
|
||||
if err := proto.MarshalText(&textBuffer, got); err != nil {
|
||||
t.Errorf("unable to marshal text: %v", err)
|
||||
}
|
||||
t.Logf("got: %s", string(textBuffer.Bytes()))
|
||||
t.Logf("got: %s", textBuffer.String())
|
||||
|
||||
// Check the options.
|
||||
wantOptions := &Options{}
|
||||
|
||||
+1
-1
@@ -715,7 +715,7 @@ func (ds *decodeState) Load(obj reflect.Value) {
|
||||
fmt.Fprintf(&buf, "%q", cycleOS.obj.Type())
|
||||
}
|
||||
buf.WriteString("}")
|
||||
Failf("incomplete graph: %s", string(buf.Bytes()))
|
||||
Failf("incomplete graph: %s", buf.String())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -141,5 +141,5 @@ func (s *Stats) String() string {
|
||||
buf.WriteString("-----------------+----------+------------------+----------------\n")
|
||||
buf.WriteString(fmt.Sprintf("% 16s | % 8d | % 16s | [all]",
|
||||
total, count, total/time.Duration(count)))
|
||||
return string(buf.Bytes())
|
||||
return buf.String()
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ func convertExpression(s string, imports mapValue, used map[string]*importedPack
|
||||
return "", err
|
||||
}
|
||||
|
||||
return string(buf.Bytes()), nil
|
||||
return buf.String(), nil
|
||||
}
|
||||
|
||||
// updateImports replaces all maps in the input slice with copies where the
|
||||
|
||||
Reference in New Issue
Block a user