Files
affaan-m--everything-claude…/docs/tr/commands/go-build.md
T
wehub-resource-sync 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
chore: import upstream snapshot with attribution
2026-07-13 11:55:55 +08:00

184 lines
4.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
description: Go build hatalarını, go vet uyarılarını ve linter sorunlarını aşamalı olarak düzelt. Minimal, cerrahi düzeltmeler için go-build-resolver agent'ını çağırır.
---
# Go Build and Fix
Bu komut, minimal değişikliklerle Go build hatalarını aşamalı olarak düzeltmek için **go-build-resolver** agent'ını çağırır.
## Bu Komut Ne Yapar
1. **Diagnostics Çalıştır**: `go build`, `go vet`, `staticcheck` yürüt
2. **Hataları Parse Et**: Dosyaya göre grupla ve önem derecesine göre sırala
3. **Aşamalı Düzelt**: Bir seferde bir hata
4. **Her Düzeltmeyi Doğrula**: Her değişiklikten sonra build'i yeniden çalıştır
5. **Özet Raporla**: Neyin düzeltildiğini ve neyin kaldığını göster
## Ne Zaman Kullanılır
`/go-build` komutunu şu durumlarda kullanın:
- `go build ./...` hatalarla başarısız olduğunda
- `go vet ./...` sorunlar raporladığında
- `golangci-lint run` uyarılar gösterdiğinde
- Modül bağımlılıkları bozulduğunda
- Build'i bozan değişiklikleri pull ettikten sonra
## Çalıştırılan Diagnostic Komutları
```bash
# Birincil build kontrolü
go build ./...
# Static analiz
go vet ./...
# Genişletilmiş linting (mevcutsa)
staticcheck ./...
golangci-lint run
# Modül sorunları
go mod verify
go mod tidy -v
```
## Örnek Oturum
```text
Kullanıcı: /go-build
Agent:
# Go Build Çözümü
## İlk Diagnostics
```bash
$ go build ./...
internal/service/user.go:25:15: undefined: UserRepository
internal/handler/api.go:42:9: cannot use x (type string) as type int
internal/handler/api.go:58:2: missing return at end of function
```
Bulunan hatalar: 3
## Düzeltme 1: Tanımsız Tanımlayıcı
Dosya: internal/service/user.go:25
Hata: undefined: UserRepository
Neden: Eksik import
```go
// Import eklendi
import "project/internal/repository"
// Değiştirildi
var repo UserRepository
// Şuna
var repo repository.UserRepository
```
```bash
$ go build ./...
# 2 hata kaldı
```
## Düzeltme 2: Tip Uyuşmazlığı
Dosya: internal/handler/api.go:42
Hata: cannot use x (type string) as type int
```go
// Değiştirildi
count := params.Get("count")
// Şuna
countStr := params.Get("count")
count, _ := strconv.Atoi(countStr)
```
```bash
$ go build ./...
# 1 hata kaldı
```
## Düzeltme 3: Eksik Return
Dosya: internal/handler/api.go:58
Hata: missing return at end of function
```go
func GetUser(id string) (*User, error) {
if id == "" {
return nil, ErrInvalidID
}
user := findUser(id)
// Eksik return eklendi
return user, nil
}
```
```bash
$ go build ./...
# Build başarılı!
```
## Son Doğrulama
```bash
$ go vet ./...
# Sorun yok
$ go test ./...
ok project/internal/service 0.015s
ok project/internal/handler 0.023s
```
## Özet
| Metrik | Sayı |
|--------|-------|
| Düzeltilen build hataları | 3 |
| Düzeltilen vet uyarıları | 0 |
| Değiştirilen dosyalar | 2 |
| Kalan sorunlar | 0 |
Build Durumu: PASS: BAŞARILI
```
## Düzeltilen Yaygın Hatalar
| Hata | Tipik Düzeltme |
|-------|-------------|
| `undefined: X` | Import ekle veya yazım hatasını düzelt |
| `cannot use X as Y` | Tip dönüşümü veya atamayı düzelt |
| `missing return` | Return ifadesi ekle |
| `X does not implement Y` | Eksik metod ekle |
| `import cycle` | Paketleri yeniden yapılandır |
| `declared but not used` | Değişkeni kaldır veya kullan |
| `cannot find package` | `go get` veya `go mod tidy` |
## Düzeltme Stratejisi
1. **Önce build hataları** - Kodun compile edilmesi gerekli
2. **İkinci olarak vet uyarıları** - Şüpheli yapıları düzelt
3. **Üçüncü olarak lint uyarıları** - Stil ve en iyi uygulamalar
4. **Bir seferde bir düzeltme** - Her değişikliği doğrula
5. **Minimal değişiklikler** - Refactor etme, sadece düzelt
## Durdurma Koşulları
Agent şu durumlarda durur ve raporlar:
- Aynı hata 3 denemeden sonra devam ederse
- Düzeltme daha fazla hata oluşturursa
- Mimari değişiklikler gerektirirse
- Harici bağımlılıklar eksikse
## İlgili Komutlar
- `/go-test` - Build başarılı olduktan sonra testleri çalıştır
- `/go-review` - Kod kalitesini incele
- `/verify` - Tam doğrulama döngüsü
## İlgili
- Agent: `agents/go-build-resolver.md`
- Skill: `skills/golang-patterns/`