Skip to content

Commit df123f9

Browse files
committed
lint, format
1 parent b386844 commit df123f9

File tree

14 files changed

+166
-616
lines changed

14 files changed

+166
-616
lines changed

.github/workflows/ci.yaml

Lines changed: 0 additions & 58 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 0 additions & 254 deletions
This file was deleted.

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: build test clean docker run dev lint benchmark install
1+
.PHONY: build test clean docker run dev lint benchmark install format tidy deps publish help
22

33
# Build variables
44
BINARY_NAME=sentinel
@@ -87,8 +87,8 @@ install:
8787
# Run linter
8888
lint:
8989
@echo "Running linter..."
90-
@which golangci-lint > /dev/null || (echo "golangci-lint not installed. Run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest" && exit 1)
91-
golangci-lint run
90+
if ! command -v golangci-lint > /dev/null; then go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest; fi
91+
$(shell go env GOPATH)/bin/golangci-lint run --fix
9292

9393
# Run benchmarks
9494
benchmark:

cmd/etl/main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ func main() {
6262
fmt.Fprintf(os.Stderr, "Failed to initialize logger: %v\n", err)
6363
os.Exit(1)
6464
}
65-
defer log.Sync()
65+
defer func() {
66+
if err := log.Sync(); err != nil {
67+
fmt.Fprintf(os.Stderr, "Log sync failed: %v\n", err)
68+
}
69+
}()
6670

6771
log.Info("Starting LLM-Sentinel ETL Pipeline",
6872
zap.String("version", "0.1.0"),

cmd/sentinel/main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ func main() {
7171
fmt.Fprintf(os.Stderr, "Failed to initialize logger: %v\n", err)
7272
os.Exit(1)
7373
}
74-
defer log.Sync()
74+
defer func() {
75+
if err := log.Sync(); err != nil {
76+
fmt.Fprintf(os.Stderr, "Log sync failed: %v\n", err)
77+
}
78+
}()
7579

7680
log.Info("Starting LLM-Sentinel",
7781
zap.String("version", version),

internal/cache/types.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ type SearchOptions struct {
5555
}
5656

5757
func (vc *VectorCache) Set(ctx context.Context, key string, embedding []float32) error {
58-
// Serialize embedding (e.g., to JSON or binary)
59-
data, err := json.Marshal(embedding)
60-
if err != nil {
61-
return err
62-
}
63-
return vc.client.Set(ctx, key, data, 0).Err()
58+
// Serialize embedding (e.g., to JSON or binary)
59+
data, err := json.Marshal(embedding)
60+
if err != nil {
61+
return err
62+
}
63+
return vc.client.Set(ctx, key, data, 0).Err()
6464
}

0 commit comments

Comments
 (0)