All skills

golang-testing

Official
by Api.AirforcePrepends a system promptTesting & QA000 uses202,700

Table-driven testler, subtestler, benchmark'lar, fuzzing ve test coverage içeren Go test desenleri. TDD metodolojisi ile idiomatic Go uygulamalarını takip eder.

open-sourceclaude-codetesting-qaaffaan-m
Share

What this skill does

When applied, it prepends a system prompt before your request is sent — no extra calls and no change to how you are billed beyond the added tokens.

---
name: golang-testing
description: Table-driven testler, subtestler, benchmark'lar, fuzzing ve test coverage içeren Go test desenleri. TDD metodolojisi ile idiomatic Go uygulamalarını takip eder.
origin: ECC
---

# Go Test Desenleri

TDD metodolojisini takip eden güvenilir, bakımı kolay testler yazmak için kapsamlı Go test desenleri.

## Ne Zaman Etkinleştirmeli

- Yeni Go fonksiyonları veya metodları yazarken
- Mevcut koda test coverage eklerken
- Performans-kritik kod için benchmark'lar oluştururken
- Input validation için fuzz testler implement ederken
- Go projelerinde TDD workflow'u takip ederken

## Go için TDD Workflow'u

### RED-GREEN-REFACTOR Döngüsü

```
RED     → Önce başarısız bir test yaz
GREEN   → Testi geçirmek için minimal kod yaz
REFACTOR → Testleri yeşil tutarken kodu iyileştir
REPEAT  → Sonraki gereksinimle devam et
```

### Go'da Adım Adım TDD

```go
// Adım 1: Interface/signature'ı tanımla
// calculator.go
package calculator

func Add(a, b int) int {
    panic("not implemented") // Placeholder
}

// Adım 2: Başarısız test yaz (RED)
// calculator_test.go
package calculator

import "testing"

func TestAdd(t *testing.T) {
    got := Add(2, 3)
    want := 5
    if got != want {
        t.Errorf("Add(2, 3) = %d; want %d", got, want)
    }
}

// Adım 3: Testi çalıştır - FAIL'i doğrula
// $ go test
// --- FAIL: TestAdd (0.00s)
// panic: not implemented

// Adım 4: Minimal kodu implement et (GREEN)
func Add(a, b int) int {
    return a + b
}

// Adım 5: Testi çalıştır - PASS'i doğrula
// $ go test
// PASS

// Adım 6: Gerekirse refactor et, testlerin hala geçtiğini doğrula
```

## Table-Driven Testler

Go testleri için standart desen. Minimal kodla kapsamlı coverage sağlar.

```go
func TestAdd(t *testing.T) {
    tests := []struct {
        name     string
        a, b     int
        expected int
    }{
        {"positive numbers", 2, 3, 5},
        {"negative numbers", -1, -2, -3},
        {"zero values", 0, 0, 0},
        {"mixed signs", -1, 1, 0},

Use this skill

Per request

Add a "skill" field with the skill’s ID to your chat completion request. It is applied server-side before your prompt is sent — no extra calls.

{
  "model": "gpt-4o-mini",
  "skill": "imp-c719b992-6904-43a3-a3cf-cdaeac5cff3e",
  "messages": [{ "role": "user", "content": "…" }]
}
Always on — no field to send

Install the skill, enable it in your dashboard and (optionally) limit it to specific models. It then applies automatically to every matching request — with no "skill" field to send each time.

Set it up in your dashboard