chore(internal): linter complaints

This commit is contained in:
Jakob Borg
2025-06-06 13:45:44 +02:00
parent ef6d561c66
commit e25de22705
4 changed files with 8 additions and 4 deletions
+1
View File
@@ -21,6 +21,7 @@ var (
Namespace: "syncthing",
Subsystem: "db",
Name: "operations_current",
Help: "Number of database operations currently ongoing, per folder and operation",
}, []string{"folder", "operation"})
metricTotalOperationSeconds = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: "syncthing",
+2 -2
View File
@@ -37,7 +37,7 @@ func NewTyped(db KV, prefix string) *Typed {
// is overwritten.
func (n *Typed) PutInt64(key string, val int64) error {
var valBs [8]byte
binary.BigEndian.PutUint64(valBs[:], uint64(val))
binary.BigEndian.PutUint64(valBs[:], uint64(val)) //nolint:gosec
return n.db.PutKV(n.prefixedKey(key), valBs[:])
}
@@ -49,7 +49,7 @@ func (n *Typed) Int64(key string) (int64, bool, error) {
return 0, false, filterNotFound(err)
}
val := binary.BigEndian.Uint64(valBs)
return int64(val), true, nil
return int64(val), true, nil //nolint:gosec
}
// PutTime stores a new time.Time. Any existing value (even if of another