Skip to content

Commit 0fb2601

Browse files
Fix CI: update Go version and fix lint errors
- Update Dockerfile to Go 1.24 (matches go.mod) - Update GitHub Actions to Go 1.24 - Fix errcheck: handle return values from viper.BindPFlag, json.Encode, etc. - Fix gosimple: remove redundant nil check before len() - Fix staticcheck: use grpc.NewClient instead of deprecated DialContext - Add nolint for Qdrant SDK deprecation (no replacement available yet) - Update golangci-lint action to v6
1 parent 41c5287 commit 0fb2601

12 files changed

Lines changed: 30 additions & 33 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Set up Go
1616
uses: actions/setup-go@v5
1717
with:
18-
go-version: '1.22'
18+
go-version: '1.24'
1919

2020
- name: Download dependencies
2121
run: go mod download
@@ -34,9 +34,9 @@ jobs:
3434
- name: Set up Go
3535
uses: actions/setup-go@v5
3636
with:
37-
go-version: '1.22'
37+
go-version: '1.24'
3838

3939
- name: golangci-lint
40-
uses: golangci/golangci-lint-action@v4
40+
uses: golangci/golangci-lint-action@v6
4141
with:
4242
version: latest

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Set up Go
2020
uses: actions/setup-go@v5
2121
with:
22-
go-version: '1.22'
22+
go-version: '1.24'
2323

2424
- name: Run GoReleaser
2525
uses: goreleaser/goreleaser-action@v5

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage
2-
FROM golang:1.22-alpine AS builder
2+
FROM golang:1.24-alpine AS builder
33

44
WORKDIR /app
55

cmd/analyze.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ func init() {
4141
analyzeCmd.Flags().IntP("workers", "w", 0, "number of parallel workers (0 = NumCPU)")
4242
analyzeCmd.Flags().Int64("seed", 0, "random seed for reproducibility (0 = random)")
4343

44-
analyzeCmd.MarkFlagRequired("file")
44+
_ = analyzeCmd.MarkFlagRequired("file")
4545

46-
viper.BindPFlag("analyze.threshold", analyzeCmd.Flags().Lookup("threshold"))
47-
viper.BindPFlag("analyze.clusters", analyzeCmd.Flags().Lookup("clusters"))
46+
_ = viper.BindPFlag("analyze.threshold", analyzeCmd.Flags().Lookup("threshold"))
47+
_ = viper.BindPFlag("analyze.clusters", analyzeCmd.Flags().Lookup("clusters"))
4848
}
4949

5050
func runAnalyze(cmd *cobra.Command, args []string) error {

cmd/api.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ func corsMiddleware(next http.Handler) http.Handler {
207207

208208
func (s *APIServer) handleRoot(w http.ResponseWriter, r *http.Request) {
209209
w.Header().Set("Content-Type", "application/json")
210-
json.NewEncoder(w).Encode(map[string]interface{}{
210+
_ = json.NewEncoder(w).Encode(map[string]interface{}{
211211
"name": "Distill API",
212212
"version": "1.0.0",
213213
"docs": "https://distill.siddhantkhare.com/docs",
@@ -357,10 +357,10 @@ func (s *APIServer) handleDedupe(w http.ResponseWriter, r *http.Request) {
357357
}
358358

359359
w.Header().Set("Content-Type", "application/json")
360-
json.NewEncoder(w).Encode(resp)
360+
_ = json.NewEncoder(w).Encode(resp)
361361
}
362362

363363
func (s *APIServer) handleHealth(w http.ResponseWriter, r *http.Request) {
364364
w.Header().Set("Content-Type", "application/json")
365-
json.NewEncoder(w).Encode(map[string]string{"status": "ok"})
365+
_ = json.NewEncoder(w).Encode(map[string]string{"status": "ok"})
366366
}

cmd/mcp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ func runMCP(cmd *cobra.Command, args []string) error {
241241
// Health check endpoint
242242
mux.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) {
243243
w.Header().Set("Content-Type", "application/json")
244-
w.Write([]byte(`{"status":"ok","server":"govectorsync-mcp"}`))
244+
_, _ = w.Write([]byte(`{"status":"ok","server":"govectorsync-mcp"}`))
245245
})
246246

247247
// MCP endpoint with stateful sessions

cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func init() {
4545
rootCmd.PersistentFlags().Bool("verbose", false, "enable verbose output")
4646

4747
// Bind to viper
48-
viper.BindPFlag("verbose", rootCmd.PersistentFlags().Lookup("verbose"))
48+
_ = viper.BindPFlag("verbose", rootCmd.PersistentFlags().Lookup("verbose"))
4949
}
5050

5151
// initConfig reads in config file and ENV variables if set.

cmd/serve.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ func init() {
6262
serveCmd.Flags().Bool("enable-mmr", true, "Enable MMR re-ranking")
6363

6464
// Bind to viper
65-
viper.BindPFlag("serve.port", serveCmd.Flags().Lookup("port"))
66-
viper.BindPFlag("serve.host", serveCmd.Flags().Lookup("host"))
65+
_ = viper.BindPFlag("serve.port", serveCmd.Flags().Lookup("port"))
66+
_ = viper.BindPFlag("serve.host", serveCmd.Flags().Lookup("host"))
6767
}
6868

6969
// Server holds the HTTP server state.
@@ -359,18 +359,18 @@ func (s *Server) handleRetrieve(w http.ResponseWriter, r *http.Request) {
359359
}
360360

361361
w.Header().Set("Content-Type", "application/json")
362-
json.NewEncoder(w).Encode(resp)
362+
_ = json.NewEncoder(w).Encode(resp)
363363
}
364364

365365
func (s *Server) handleHealth(w http.ResponseWriter, r *http.Request) {
366366
w.Header().Set("Content-Type", "application/json")
367-
json.NewEncoder(w).Encode(map[string]string{"status": "ok"})
367+
_ = json.NewEncoder(w).Encode(map[string]string{"status": "ok"})
368368
}
369369

370370
func (s *Server) handleMetrics(w http.ResponseWriter, r *http.Request) {
371371
cfg := s.broker.GetConfig()
372372
w.Header().Set("Content-Type", "application/json")
373-
json.NewEncoder(w).Encode(map[string]interface{}{
373+
_ = json.NewEncoder(w).Encode(map[string]interface{}{
374374
"config": map[string]interface{}{
375375
"over_fetch_k": cfg.OverFetchK,
376376
"target_k": cfg.TargetK,

cmd/sync.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func init() {
3535

3636
// File input
3737
syncCmd.Flags().StringP("file", "f", "", "path to JSONL file containing vectors (required)")
38-
syncCmd.MarkFlagRequired("file")
38+
_ = syncCmd.MarkFlagRequired("file")
3939

4040
// Pinecone settings
4141
syncCmd.Flags().StringP("index", "i", "", "Pinecone index name (required)")
@@ -52,9 +52,9 @@ func init() {
5252
syncCmd.Flags().IntP("batch-size", "b", 100, "vectors per batch (Pinecone optimal: 100)")
5353

5454
// Bind to viper
55-
viper.BindPFlag("api_key", syncCmd.Flags().Lookup("api-key"))
56-
viper.BindPFlag("index", syncCmd.Flags().Lookup("index"))
57-
viper.BindPFlag("namespace", syncCmd.Flags().Lookup("namespace"))
55+
_ = viper.BindPFlag("api_key", syncCmd.Flags().Lookup("api-key"))
56+
_ = viper.BindPFlag("index", syncCmd.Flags().Lookup("index"))
57+
_ = viper.BindPFlag("namespace", syncCmd.Flags().Lookup("namespace"))
5858
}
5959

6060
func runSync(cmd *cobra.Command, args []string) error {
@@ -185,7 +185,7 @@ func runSync(cmd *cobra.Command, args []string) error {
185185
current := stats.UploadedVectors + stats.FailedVectors
186186
delta := current - lastUploaded
187187
if delta > 0 {
188-
bar.Add64(delta)
188+
_ = bar.Add64(delta)
189189
lastUploaded = current
190190
}
191191
}
@@ -197,7 +197,7 @@ func runSync(cmd *cobra.Command, args []string) error {
197197
return fmt.Errorf("ingestion failed: %w", err)
198198
}
199199

200-
bar.Finish()
200+
_ = bar.Finish()
201201
fmt.Fprintln(os.Stderr)
202202

203203
// Print summary

pkg/pinecone/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ func (c *Client) Close() error {
178178

179179
// convertMetadata converts map[string]interface{} to Pinecone Struct metadata.
180180
func convertMetadata(m map[string]interface{}) *structpb.Struct {
181-
if m == nil || len(m) == 0 {
181+
if len(m) == 0 {
182182
return nil
183183
}
184184

0 commit comments

Comments
 (0)