Skip to content

Commit d0d3f76

Browse files
intel352claude
andcommitted
fix: correct gofmt formatting and nolint directive syntax
- Fix gofmt alignment in feeders/yaml.go, phase.go, tenant_service.go - Change //nolint:G118 to //nolint:gosec (golangci-lint uses linter names) - Add G118 suppression for durable_memory.go and kafka.go - Fix contextcheck nolint in scheduler.go - Suppress SA1019 on proxy.Director = nil (required when using Rewrite) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ae21c93 commit d0d3f76

10 files changed

Lines changed: 11 additions & 11 deletions

File tree

feeders/yaml.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func getFieldNameFromTag(fieldType *reflect.StructField) (string, bool) {
5656
type YamlFeeder struct {
5757
Path string
5858
verboseDebug bool
59-
debugFn func(string)
59+
debugFn func(string)
6060
fieldTracker FieldTracker
6161
priority int
6262
}

modules/eventbus/durable_memory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ func (d *DurableMemoryEventBus) Start(ctx context.Context) error {
216216
if d.isStarted {
217217
return nil
218218
}
219-
d.ctx, d.cancel = context.WithCancel(ctx)
219+
d.ctx, d.cancel = context.WithCancel(ctx) //nolint:gosec // G118: cancel is stored in d.cancel and called in Stop()
220220
d.isStarted = true
221221
return nil
222222
}

modules/eventbus/kafka.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ func (k *KafkaEventBus) Start(ctx context.Context) error {
235235
return nil
236236
}
237237

238-
k.ctx, k.cancel = context.WithCancel(ctx)
238+
k.ctx, k.cancel = context.WithCancel(ctx) //nolint:gosec // G118: cancel is stored in k.cancel and called in Stop()
239239
k.isStarted = true
240240
return nil
241241
}

modules/eventbus/memory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func (m *MemoryEventBus) Start(ctx context.Context) error {
113113
return nil
114114
}
115115

116-
m.ctx, m.cancel = context.WithCancel(ctx) //nolint:G118 // cancel is stored in m.cancel and called in Stop()
116+
m.ctx, m.cancel = context.WithCancel(ctx) //nolint:gosec // G118: cancel is stored in m.cancel and called in Stop()
117117

118118
// Initialize worker pool for async event handling.
119119
// Buffer size is MaxEventQueueSize so the task queue can absorb bursts

modules/eventbus/nats.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ func (n *NatsEventBus) Start(ctx context.Context) error {
177177
return ErrNATSConnectionNotEstablished
178178
}
179179

180-
n.ctx, n.cancel = context.WithCancel(ctx) //nolint:G118 // cancel is stored in n.cancel and called in Stop()
180+
n.ctx, n.cancel = context.WithCancel(ctx) //nolint:gosec // G118: cancel is stored in n.cancel and called in Stop()
181181
n.isStarted = true
182182
return nil
183183
}

modules/eventbus/redis.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func (r *RedisEventBus) Start(ctx context.Context) error {
140140
return fmt.Errorf("failed to connect to Redis: %w", err)
141141
}
142142

143-
r.ctx, r.cancel = context.WithCancel(ctx) //nolint:G118 // cancel is stored in r.cancel and called in Stop()
143+
r.ctx, r.cancel = context.WithCancel(ctx) //nolint:gosec // G118: cancel is stored in r.cancel and called in Stop()
144144
r.isStarted = true
145145
return nil
146146
}

modules/reverseproxy/module.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1698,7 +1698,7 @@ func (m *ReverseProxyModule) createReverseProxyForBackend(ctx context.Context, t
16981698
}
16991699
}
17001700
}
1701-
proxy.Director = nil
1701+
proxy.Director = nil //nolint:staticcheck // SA1019: explicitly nil Director when using Rewrite per Go docs
17021702

17031703
// Set up error handler to return proper HTTP status codes for connection failures
17041704
proxy.ErrorHandler = func(w http.ResponseWriter, r *http.Request, err error) {

modules/scheduler/scheduler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,13 @@ func (s *Scheduler) Start(ctx context.Context) error {
194194
s.logger.Info("Starting scheduler", "workers", s.workerCount, "queueSize", s.queueSize)
195195
}
196196

197-
s.ctx, s.cancel = context.WithCancel(ctx) //nolint:G118 // cancel is stored in s.cancel and called in Stop()
197+
s.ctx, s.cancel = context.WithCancel(ctx) //nolint:gosec // G118: cancel is stored in s.cancel and called in Stop()
198198
s.jobQueue = make(chan Job, s.queueSize)
199199

200200
// Start worker goroutines
201201
for i := 0; i < s.workerCount; i++ {
202202
s.wg.Add(1)
203-
//nolint:contextcheck,G118 // Context is passed through s.ctx field; workers use s.ctx
203+
//nolint:contextcheck,gosec // Context is passed through s.ctx field; workers use s.ctx
204204
go s.worker(i)
205205

206206
// Emit worker started event

phase.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package modular
44
type AppPhase int32
55

66
const (
7-
PhaseCreated AppPhase = iota
7+
PhaseCreated AppPhase = iota
88
PhaseInitializing
99
PhaseInitialized
1010
PhaseStarting

tenant_service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
package modular
44

55
import (
6-
"slices"
76
"fmt"
7+
"slices"
88
"sync"
99
)
1010

0 commit comments

Comments
 (0)