d48cda4081
CI / Test (ubuntu-latest, Node 18.x, bun) (push) Failing after 15m1s
CI / Test (ubuntu-latest, Node 18.x, npm) (push) Failing after 15m1s
CI / Test (ubuntu-latest, Node 18.x, pnpm) (push) Failing after 15m1s
CI / Test (ubuntu-latest, Node 18.x, yarn) (push) Failing after 15m1s
CI / Test (ubuntu-latest, Node 20.x, bun) (push) Failing after 17m13s
CI / Test (ubuntu-latest, Node 20.x, npm) (push) Failing after 18m42s
CI / Test (ubuntu-latest, Node 20.x, pnpm) (push) Failing after 15m0s
CI / Test (ubuntu-latest, Node 20.x, yarn) (push) Failing after 49m44s
CI / Test (ubuntu-latest, Node 22.x, bun) (push) Failing after 51m55s
CI / Test (ubuntu-latest, Node 22.x, pnpm) (push) Failing after 21m57s
CI / Test (ubuntu-latest, Node 22.x, npm) (push) Failing after 37m39s
CI / Test (ubuntu-latest, Node 22.x, yarn) (push) Failing after 34m7s
CI / Validate Components (push) Failing after 37m15s
CI / Python Tests (push) Failing after 10m1s
CI / Security Scan (push) Failing after 10m1s
CI / Lint (push) Failing after 17m12s
CI / Coverage (push) Failing after 20m19s
CI / Test (macos-latest, Node 18.x, bun) (push) Has been cancelled
CI / Test (macos-latest, Node 18.x, npm) (push) Has been cancelled
CI / Test (macos-latest, Node 18.x, pnpm) (push) Has been cancelled
CI / Test (macos-latest, Node 18.x, yarn) (push) Has been cancelled
CI / Test (windows-latest, Node 18.x, npm) (push) Has been cancelled
CI / Test (windows-latest, Node 18.x, pnpm) (push) Has been cancelled
CI / Test (windows-latest, Node 18.x, yarn) (push) Has been cancelled
CI / Test (macos-latest, Node 20.x, bun) (push) Has been cancelled
CI / Test (macos-latest, Node 20.x, npm) (push) Has been cancelled
CI / Test (macos-latest, Node 20.x, pnpm) (push) Has been cancelled
CI / Test (macos-latest, Node 20.x, yarn) (push) Has been cancelled
CI / Test (windows-latest, Node 20.x, npm) (push) Has been cancelled
CI / Test (windows-latest, Node 20.x, pnpm) (push) Has been cancelled
CI / Test (windows-latest, Node 20.x, yarn) (push) Has been cancelled
CI / Test (macos-latest, Node 22.x, bun) (push) Has been cancelled
CI / Test (macos-latest, Node 22.x, npm) (push) Has been cancelled
CI / Test (macos-latest, Node 22.x, pnpm) (push) Has been cancelled
CI / Test (macos-latest, Node 22.x, yarn) (push) Has been cancelled
CI / Test (windows-latest, Node 22.x, npm) (push) Has been cancelled
CI / Test (windows-latest, Node 22.x, pnpm) (push) Has been cancelled
CI / Test (windows-latest, Node 22.x, yarn) (push) Has been cancelled
3.8 KiB
3.8 KiB
description
| description |
|---|
| İdiomatic desenler, eşzamanlılık güvenliği, hata yönetimi ve güvenlik için kapsamlı Go kod incelemesi. go-reviewer agent'ını çağırır. |
Go Code Review
Bu komut, Go'ya özel kapsamlı kod incelemesi için go-reviewer agent'ını çağırır.
Bu Komut Ne Yapar
- Go Değişikliklerini Tanımla:
git diffile değiştirilmiş.godosyalarını bul - Static Analiz Çalıştır:
go vet,staticcheckvegolangci-lintyürüt - Güvenlik Taraması: SQL injection, command injection, race condition'ları kontrol et
- Eşzamanlılık İncelemesi: Goroutine güvenliğini, channel kullanımını, mutex desenlerini analiz et
- İdiomatic Go Kontrolü: Kodun Go kurallarına ve en iyi uygulamalara uyduğunu doğrula
- Rapor Oluştur: Sorunları önem derecesine göre kategorize et
Ne Zaman Kullanılır
/go-review komutunu şu durumlarda kullanın:
- Go kodu yazdıktan veya değiştirdikten sonra
- Go değişikliklerini commit etmeden önce
- Go kodu içeren pull request'leri incelerken
- Yeni bir Go kod tabanına adapte olurken
- İdiomatic Go desenlerini öğrenirken
İnceleme Kategorileri
KRİTİK (Düzeltilmeli)
- SQL/Command injection açıklıkları
- Senkronizasyon olmadan race condition'lar
- Goroutine sızıntıları
- Hardcode edilmiş kimlik bilgileri
- Güvenli olmayan pointer kullanımı
- Kritik yollarda göz ardı edilen hatalar
YÜKSEK (Düzeltilmeli)
- Bağlamlı hata sarmalama eksikliği
- Hata dönüşleri yerine panic
- Context yayılmıyor
- Deadlock'a neden olan buffersız channel'lar
- Interface yerine getirilmeme hataları
- Eksik mutex koruması
ORTA (Düşünün)
- İdiomatic olmayan kod desenleri
- Export edilen elementlerde eksik godoc yorumları
- Verimsiz string birleştirme
- Preallocate edilmemiş slice
- Table-driven testler kullanılmamış
Çalıştırılan Otomatik Kontroller
# Static analiz
go vet ./...
# Gelişmiş kontroller (kuruluysa)
staticcheck ./...
golangci-lint run
# Race tespiti
go build -race ./...
# Güvenlik açıklıkları
govulncheck ./...
Örnek Kullanım
Kullanıcı: /go-review
Agent:
# Go Kod İnceleme Raporu
## İncelenen Dosyalar
- internal/handler/user.go (değiştirildi)
- internal/service/auth.go (değiştirildi)
## Static Analiz Sonuçları
✓ go vet: Sorun yok
✓ staticcheck: Sorun yok
## Bulunan Sorunlar
[KRİTİK] Race Condition
Dosya: internal/service/auth.go:45
Sorun: Paylaşılan map senkronizasyon olmadan erişiliyor
```go
var cache = map[string]*Session{} // Eşzamanlı erişim!
func GetSession(id string) *Session {
return cache[id] // Race condition
}
Düzeltme: sync.RWMutex veya sync.Map kullan
var (
cache = map[string]*Session{}
cacheMu sync.RWMutex
)
func GetSession(id string) *Session {
cacheMu.RLock()
defer cacheMu.RUnlock()
return cache[id]
}
[YÜKSEK] Eksik Hata Bağlamı Dosya: internal/handler/user.go:28 Sorun: Hata bağlam olmadan döndürülüyor
return err // Bağlam yok
Düzeltme: Bağlamla sarmala
return fmt.Errorf("get user %s: %w", userID, err)
Özet
- KRİTİK: 1
- YÜKSEK: 1
- ORTA: 0
Öneri: FAIL: KRİTİK sorun düzeltilene kadar merge'i engelle
## Onay Kriterleri
| Durum | Koşul |
|--------|-----------|
| PASS: Onayla | KRİTİK veya YÜKSEK sorun yok |
| WARNING: Uyarı | Sadece ORTA sorunlar (dikkatle merge et) |
| FAIL: Engelle | KRİTİK veya YÜKSEK sorun bulundu |
## Diğer Komutlarla Entegrasyon
- Testlerin geçtiğinden emin olmak için önce `/go-test` kullanın
- Build hataları oluşursa `/go-build` kullanın
- Commit etmeden önce `/go-review` kullanın
- Go'ya özel olmayan endişeler için `/code-review` kullanın
## İlgili
- Agent: `agents/go-reviewer.md`
- Skills: `skills/golang-patterns/`, `skills/golang-testing/`