Skip to content

fix: resolve go vet warnings and add pprof production safety#276

Merged
devfeel merged 1 commit intoaicodefrom
aicode-fix-vet-warnings
Mar 2, 2026
Merged

fix: resolve go vet warnings and add pprof production safety#276
devfeel merged 1 commit intoaicodefrom
aicode-fix-vet-warnings

Conversation

@devfeel
Copy link
Owner

@devfeel devfeel commented Mar 1, 2026

Description

Fix code quality issues and improve security

Changes

P0: Go Vet 警告修复

  • 修复 cache_runtime_test.go 循环变量捕获问题
  • 修复 router.go 未使用结构体字段
  • 移除 session/session.go 不可达代码
  • 修复 server_test.go sync.Pool 复制警告

P1: 生产环境安全

  • pprof 只在开发模式启用,生产模式自动关闭

Testing

  • go vet ./... 通过
  • go build ./... 通过

- Fix loop variable capture in cache_runtime_test.go
- Use keyed fields for HideReaddirFS struct in router.go
- Remove unreachable code in session/session.go
- Fix sync.Pool copy warning in server_test.go
- Only enable pprof in development mode (security)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant