chore(all): resolve lint findings, update example plugin, refine docs and add LGPL licenses

This commit is contained in:
2026-10-07 00:57:35 +08:00
parent e8e9d77974
commit 8e8ddeddb6
388 changed files with 4638 additions and 3321 deletions
@@ -49,7 +49,9 @@ func TestObserverUsesInventoryProjectionAndRestoresMemoryOnSaveFailure(t *testin
}
s.store = store
p.count = 1
s.BeforeDispatch("/grant", req(1))
if err := s.BeforeDispatch("/grant", req(1)); err != nil {
t.Fatal(err)
}
p.count = 2
b, e := s.AfterDispatch("/grant", req(1), nil)
if e != nil || len(b) == 0 {
@@ -103,7 +105,9 @@ func TestReadOnlyBatchHasNoObserverWritesButRealDeltaNotifiesOnce(t *testing.T)
// Even if an upstream replay temporarily exposes the same before/after
// delta, the committed request receipt must not increment tasks twice.
p.count = 1
s.BeforeDispatch("/grant", req(58))
if err := s.BeforeDispatch("/grant", req(58)); err != nil {
t.Fatal(err)
}
p.count = 2
b, e = s.AfterDispatch("/grant", req(58), nil)
if e != nil || len(b) != 0 || counter.writes != 1 {
+4 -3
View File
@@ -15,6 +15,7 @@ import (
"encoding/json"
"errors"
"fmt"
"slices"
"sort"
"strconv"
"sync"
@@ -173,7 +174,7 @@ func key(v ...uint64) string {
var k string
for i, n := range v {
if i > 0 {
k += "/"
k += "/" //nolint:modernize // stringsbuilder
}
k += strconv.FormatUint(n, 10)
}
@@ -498,7 +499,7 @@ func (s *Service) handle(path string, b []byte, identity string) ([]byte, error)
}
}
}
sort.Slice(ids, func(i, j int) bool { return ids[i] < ids[j] })
slices.Sort(ids)
for _, id := range ids {
rewards := s.attendanceRewards(v, a, group, id)
if len(rewards) == 0 {
@@ -549,7 +550,7 @@ func (s *Service) handle(path string, b []byte, identity string) ([]byte, error)
var u uint64
_, _ = fmt.Sscanf(uid, "%d", &u)
for g, ids := range groups {
sort.Slice(ids, func(i, j int) bool { return ids[i] < ids[j] })
slices.Sort(ids)
x := wire.AppendVarint(nil, 1, u)
x = wire.AppendVarint(x, 2, g)
for _, id := range ids {