Skip to content

Commit e31b122

Browse files
Ajit Pratap Singhclaude
authored andcommitted
fix: resolve CI failures — lint and Go 1.21 incompatibility
- cmd/gosqlx-mcp/main.go: extract run() helper so os.Exit is not called after defer stop() — fixes gocritic exitAfterDefer lint error - .github/workflows/test.yml: bump minimum Go from 1.21 to 1.23 since mark3labs/mcp-go requires go 1.23.0 - CLAUDE.md: document new minimum Go version requirement Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent daf513b commit e31b122

3 files changed

Lines changed: 12 additions & 10 deletions

File tree

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
go-version: ['1.21', '1.24']
14+
go-version: ['1.23', '1.24']
1515

1616
steps:
1717
- uses: actions/checkout@v4
@@ -34,7 +34,7 @@ jobs:
3434
fail-fast: false
3535
matrix:
3636
os: [ubuntu-latest, macos-latest, windows-latest]
37-
go: ['1.21', '1.24']
37+
go: ['1.23', '1.24']
3838
env:
3939
# Prevent Go from auto-downloading toolchain which conflicts with setup-go cache
4040
GOTOOLCHAIN: local

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
66

77
GoSQLX is a **production-ready**, **race-free**, high-performance SQL parsing SDK for Go that provides lexing, parsing, and AST generation with zero-copy optimizations. The library is designed for enterprise use with comprehensive object pooling for memory efficiency.
88

9-
**Requirements**: Go 1.21+
9+
**Requirements**: Go 1.23+ (upgraded from 1.21 when MCP server was added; `mark3labs/mcp-go` requires 1.23)
1010

1111
**Production Status**: ✅ Validated for production deployment (v1.6.0+, current: v1.9.0)
1212
- Thread-safe with zero race conditions (20,000+ concurrent operations tested)

cmd/gosqlx-mcp/main.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,20 @@ import (
4141
)
4242

4343
func main() {
44+
if err := run(); err != nil {
45+
fmt.Fprintf(os.Stderr, "gosqlx-mcp: %v\n", err)
46+
os.Exit(1)
47+
}
48+
}
49+
50+
func run() error {
4451
cfg, err := gosqlxmcp.LoadConfig()
4552
if err != nil {
46-
fmt.Fprintf(os.Stderr, "gosqlx-mcp: configuration error: %v\n", err)
47-
os.Exit(1)
53+
return fmt.Errorf("configuration error: %w", err)
4854
}
4955

5056
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
5157
defer stop()
5258

53-
srv := gosqlxmcp.New(cfg)
54-
if err := srv.Start(ctx); err != nil {
55-
fmt.Fprintf(os.Stderr, "gosqlx-mcp: %v\n", err)
56-
os.Exit(1)
57-
}
59+
return gosqlxmcp.New(cfg).Start(ctx)
5860
}

0 commit comments

Comments
 (0)