fix(lint): resolve 64 pre-existing golangci-lint violations in workspace-server #803
@ -152,6 +152,7 @@ func TestIsSafeRoleName_Acceptance(t *testing.T) {
|
||||
t.Errorf("isSafeRoleName(%q) = false; want true", s)
|
||||
}
|
||||
}
|
||||
// trailing-hyphen IS allowed; only include actually-bad names:
|
||||
bad := []string{
|
||||
"", ".", "..", "with/slash", "/abs", "dot.in.middle",
|
||||
"with space", "back\\slash", "with$dollar", "with?question",
|
||||
|
||||
@ -275,7 +275,7 @@ func (h *TemplatesHandler) ListFiles(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
// Translate to the handler's wire shape (the field names match
|
||||
// 1:1, but Go can't implicit-convert named struct types).
|
||||
// 1:1, so we can use a direct type conversion).
|
||||
out := make([]fileEntry, 0, len(entries))
|
||||
for _, e := range entries {
|
||||
out = append(out, fileEntry(e))
|
||||
|
||||
@ -145,9 +145,7 @@ func (h *WorkspaceHandler) Update(c *gin.Context) {
|
||||
|
||||
// Auth is fully enforced at the router layer (WorkspaceAuth middleware, #680).
|
||||
// WorkspaceAuth validates that the caller holds a valid bearer token for this
|
||||
// specific workspace — no additional auth gate is needed here. The
|
||||
// sensitiveUpdateFields map above documents the risk classification for
|
||||
// auditors but is no longer used as a runtime gate.
|
||||
// specific workspace — no additional auth gate is needed here.
|
||||
|
||||
// #120: guard — return 404 for nonexistent workspace IDs instead of
|
||||
// silently applying zero-row UPDATEs and returning 200.
|
||||
|
||||
@ -793,8 +793,7 @@ func TestDoJSON_204OnEndpointExpectingBody(t *testing.T) {
|
||||
t.Fatalf("Search: %v", err)
|
||||
}
|
||||
if got == nil {
|
||||
t.Error("got nil SearchResponse, want zero value")
|
||||
return
|
||||
t.Fatal("got nil SearchResponse, want zero value")
|
||||
}
|
||||
if len(got.Memories) != 0 {
|
||||
t.Errorf("memories = %v, want empty", got.Memories)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user