GitHub Copilot untuk Golang 2026: Setup, Chat, Workspace, PR Review
Panduan lengkap GitHub Copilot untuk Go development 2026. Setup, Copilot Chat, Copilot Workspace, PR review automation, dan custom instructions untuk Golang project.
GitHub Copilot untuk Go: Chat, Completions, Workspace
Memilih GitHub Copilot untuk Golang bukan soal mencari tool dengan kemampuan code generation paling ganas. Copilot mungkin bukan yang paling powerful untuk pure generation, tapi punya keunggulan yang tidak dimiliki tools lain: integrasi yang sangat dalam dengan seluruh GitHub ecosystem. Untuk tim Go yang heavily invested di GitHub — dan siapa yang tidak di 2026? — ini adalah differentiator yang decisive.
Di artikel ini kita bedah setup Copilot untuk Go, custom instructions yang membuatnya sadar konvensi proyek, inline completions, Copilot Chat, Workspace, hingga PR review automation yang jadi senjata rahasia tim.
07.1 Evolusi Copilot: Dari Autocomplete ke Agent
GitHub Copilot sudah berevolusi jauh dari sekadar “smart autocomplete”. Untuk memahami posisinya di 2026, penting melihat perjalanan fiturnya dari waktu ke waktu. Timeline berikut merangkum lompatan kapabilitas Copilot sejak rilis pertama.
12021: GitHub Copilot v1
2 → Inline completion, satu baris atau blok kecil
3 → "Type to trigger, Tab to accept"
4
52023: Copilot Chat
6 → Chat interface di IDE
7 → /commands: /explain, /fix, /tests, /doc
8 → @workspace untuk context seluruh repo
9
102024: Copilot Workspace (github.com)
11 → Issue → Plan → PR, semua di browser
12 → Copilot understands full repository
13
142025-2026: Copilot Agent Mode
15 → Multi-step autonomous tasks
16 → Integration dengan GitHub Actions
17 → PR review yang sophisticated
18 → Copilot Extensions (custom tools)Yang perlu kamu tangkap dari evolusi ini: Copilot berpindah dari sekadar melengkapi baris kode menjadi asisten yang menyentuh setiap tahap alur GitHub — dan justru di ranah GitHub-native inilah nilai terbesarnya untuk developer Go.
07.2 Setup GitHub Copilot untuk Go
Sebelum memanfaatkan fitur canggihnya, kamu perlu memasang extension dan memverifikasi Copilot aktif untuk file Go. Perintah berikut memasang extension Copilot beserta Go extension, lalu mengetes inline completion pertama.
1# Install VS Code extensions
2code --install-extension GitHub.copilot
3code --install-extension GitHub.copilot-chat
4
5# Login
6# Cmd/Ctrl+Shift+P → "GitHub Copilot: Sign in with GitHub"
7
8# Verify Go extension
9code --install-extension golang.go
10
11# Verify Copilot active
12# Bottom status bar: Copilot icon (active = circle, inactive = strikethrough)
13
14# Test inline completion
15# Buka file Go, ketik function signature, tunggu suggestions
16func CancelOrder(ctx context.Context, orderID uuid.UUID) error {
17 // → Copilot akan suggest implementationSetelah icon Copilot di status bar berbentuk lingkaran penuh dan suggestion muncul saat mengetik signature Go, berarti tool sudah siap. Langkah berikutnya adalah membuat Copilot “paham” konvensi proyek kamu.
07.3 Custom Instructions: CLAUDE.md Equivalent untuk Copilot
File .github/copilot-instructions.md adalah cara Copilot “tahu” tentang project kamu — padanan CLAUDE.md di Claude Code. Contoh berikut menetapkan arsitektur, aturan error handling, tipe data, dan exact package paths yang wajib dipatuhi.
1# .github/copilot-instructions.md
2# Santekno Shop — GitHub Copilot Instructions
3
4## Project Overview
5Go 1.22 e-commerce service. Clean Architecture.
6High-traffic, distributed system. Production-critical code.
7
8## Architecture — STRICT RULES
9Layer order: handler → usecase → repository → domain
10- handler: ONLY calls usecase interfaces
11- usecase: ONLY uses domain + repository interfaces
12- repository: ONLY returns domain types
13- domain: ZERO external imports
14
15## CRITICAL Go Conventions
16
17### Error Handling
18Repository not-found: ALWAYS return (nil, nil) — never return an error
19All error wraps: fmt.Errorf("package.FunctionName: %w", err)
20HTTP errors: {"error": "UPPERCASE_ERROR_CODE"}
21
22### Types
23Monetary values: ALWAYS int64 cents (50000 = Rp 500.00)
24Primary keys: ALWAYS UUID (github.com/google/uuid)
25Never: float64, float32 for money
26
27### Context
28Always pass ctx as FIRST parameter
29Always propagate ctx to all downstream calls
30
31## Testing
32Framework: github.com/stretchr/testify/suite
33Mocking: go.uber.org/mock/gomock (NOT testify/mock)
34No real DB in unit tests — always mock repository
35Integration tests: //go:build integration
36
37## Exact Package Paths (critical — no alternatives)
38DB: github.com/jackc/pgx/v5
39Cache: github.com/redis/go-redis/v9
40HTTP: github.com/labstack/echo/v4
41Kafka: github.com/confluentinc/confluent-kafka-go/v2
42UUID: github.com/google/uuid
43Logging: github.com/rs/zerolog
44
45## Go Version: 1.22
46NO features from Go 1.23+: range-over-func, slices.Collect, iter.Seq
47
48## What NEVER to do
49- NEVER float64 for monetary values
50- NEVER return pgx.ErrNoRows from usecase
51- NEVER ignore error with _ (in non-test code)
52- NEVER import delivery from usecase
53- NEVER interface with > 5 methods without splitting
54```Semakin eksplisit exact package paths dan daftar “NEVER” di sini, semakin jarang Copilot menebak library yang salah atau melanggar layer — file ini adalah investasi sekali tulis yang menekan koreksi manual sepanjang proyek.
07.4 Inline Completions: Yang Terbaik dari Copilot
Inline completions adalah kekuatan utama Copilot — smooth, cepat, tidak butuh context switching. Kumpulan skenario Go berikut memperlihatkan bagaimana Copilot melengkapi implementasi transaksi, struct, error handling, query SQL, hingga nama test berdasarkan pola di codebase.
1// Scenario 1: Function signature → Copilot complete implementation
2func (r *orderRepository) CancelWithStockRestore(
3 ctx context.Context,
4 orderID uuid.UUID,
5) error {
6 // → Copilot suggest: transaction-based implementation
7 // Accept dengan Tab, atau Alt+] untuk next suggestion
8
9// Scenario 2: Struct → complete semua fields
10type CancelOrderInput struct {
11 // → Copilot suggest: OrderID uuid.UUID, UserID uuid.UUID
12 // Berdasarkan pattern dari struct lain di codebase
13
14// Scenario 3: Error handling boilerplate
15order, err := uc.repo.GetByIDAndUserID(ctx, input.OrderID, input.UserID)
16// → Copilot suggest:
17// if err != nil {
18// return fmt.Errorf("cancelOrder.Execute: %w", err)
19// }
20// if order == nil {
21// return domain.ErrOrderNotFound
22// }
23
24// Scenario 4: SQL query
25const queryGetOrder = `
26 SELECT id, user_id, status, total_amount, created_at
27 FROM orders
28 WHERE -- Copilot suggest: id = $1 AND deleted_at IS NULL
29
30// Scenario 5: Test case
31func (s *CancelOrderSuite) Test
32// → Copilot suggest multiple completions:
33// TestCancelOrder_PendingOrder_Success
34// TestCancelOrder_NotFound_ReturnsError
35// TestCancelOrder_WindowExpired_ReturnsErrorPerhatikan bahwa Copilot menebak field, error code, dan nama test dari pola yang sudah ada di repo — inilah alasan inline completion terasa “membaca pikiran” saat konvensi proyek konsisten. Justru karena itu, kualitas completion sangat bergantung pada kerapian codebase yang sudah ada.
07.5 Copilot Chat: Commands yang Paling Berguna untuk Go
Selain inline, Copilot Chat menyediakan slash command yang mempercepat tugas berulang. Cuplikan berikut merangkum command paling berguna untuk Go — dari /explain hingga @workspace yang sadar konteks seluruh repo.
1# /explain — understand existing code
2# Select fungsi yang complex, lalu:
3/explain
4# "This function implements the repository pattern for order cancellation.
5# It uses a database transaction to atomically cancel the order and
6# restore stock levels..."
7
8# /tests — generate tests untuk selected code
9# Select CancelOrderUseCase.Execute, lalu:
10/tests
11# Generate: testify/suite tests berdasarkan function signature dan behavior
12
13# /fix — fix error yang di-paste
14/fix
15# Error: cannot use order (variable of type *domain.Order) as type domain.Order
16# Fix: dereference atau update signature
17
18# /doc — generate godoc
19# Select fungsi, lalu:
20/doc
21# // Execute cancels an order if it meets the cancellation criteria.
22# // It verifies that the order belongs to the specified user,
23# // is in PENDING status, and was created within the cancellation window.
24
25# @workspace — context-aware questions
26@workspace What pattern does this project use for handling not-found from repository?
27# → Copilot scan codebase, find examples, answer dengan actual code dari project
28
29@workspace What's the testing pattern for usecase tests in this project?
30# → Copilot show actual test structure dari existing testsCommand yang paling mengubah pengalaman adalah @workspace: ia mengubah Copilot dari asisten generik menjadi asisten yang menjawab berdasarkan kode aktual proyekmu, bukan pengetahuan umum.
07.6 Copilot Workspace: Issue ke PR di GitHub.com
Copilot Workspace adalah fitur di GitHub.com yang bisa mengubah Issue menjadi PR tanpa meninggalkan browser. Alur berikut menggambarkan perjalanan dari Issue bug hingga PR yang otomatis ter-link.
1Workflow:
2
31. Buat atau buka GitHub Issue:
4 Title: "Cancel order tidak restore stock saat Kafka publish gagal"
5 Body: "Ketika order di-cancel dan Kafka publish event gagal,
6 stock sudah di-restore di DB tapi order tetap CANCELLED.
7 Ini menyebabkan inconsistency..."
8
92. Click "Open in Copilot Workspace"
10 (tombol ada di kanan atas issue page)
11
123. Copilot Workspace analyze:
13 → Baca seluruh repository
14 → Understand issue context
15 → Generate implementation plan
16
174. Plan yang di-generate:
18 "File yang akan diubah:
19 1. internal/usecase/order/cancel_order.go
20 - Implementasi outbox pattern untuk Kafka
21 2. internal/repository/postgres/order_repository.go
22 - Tambahkan CreateOutboxEvent method
23 3. internal/kafka/publisher.go
24 - Buat publisher yang baca dari outbox table
25 New files:
26 4. internal/domain/outbox/entity.go
27 5. migrations/20260702_add_outbox_table.sql"
28
295. Review plan → approve → Copilot implement
30 → Buat PR dengan implementation
31
326. PR automatically linked ke issueKekuatan Workspace bukan pada implementasinya, melainkan pada tahap “plan yang di-review sebelum kode ditulis” — pola spec-first ringan yang memaksa kamu menyetujui rencana sebelum satu baris pun berubah.
07.7 Copilot PR Review: Game Changer untuk Tim
Ini adalah fitur Copilot yang paling underrated sekaligus paling valuable untuk tim. Konfigurasi GitHub Actions berikut menyalakan review otomatis pada setiap PR yang menyentuh file Go, lengkap dengan custom instructions untuk konvensi Santekno Shop.
1# Setup automatic PR review
2# .github/workflows/copilot-review.yml
3
4name: Copilot Code Review
5
6on:
7 pull_request:
8 types: [opened, ready_for_review, synchronize]
9 paths:
10 - '**.go'
11
12jobs:
13 copilot-review:
14 runs-on: ubuntu-latest
15 permissions:
16 pull-requests: write
17 contents: read
18
19 steps:
20 - uses: actions/checkout@v4
21 with:
22 fetch-depth: 0
23
24 - name: Copilot Code Review
25 uses: github/copilot-for-pull-requests@v1
26 with:
27 github-token: ${{ secrets.GITHUB_TOKEN }}
28 review-type: "code-review"
29 # Custom instructions untuk review
30 review-instructions: |
31 Review Go code untuk Santekno Shop e-commerce.
32
33 CRITICAL checks:
34 1. Error handling: fmt.Errorf("pkg.Method: %w", err) ALWAYS
35 2. Repository not-found: MUST return nil, nil (never error)
36 3. Monetary: int64 cents ONLY (never float64)
37 4. Architecture: no cross-layer imports
38 5. Context: always first parameter, always propagated
39 6. HTTP errors: {"error": "UPPERCASE_CODE"} format
40 7. No _ to ignore errors in non-test code
41
42 Format issues as:
43 CRITICAL: [issue] at [file:line] — [fix]
44 SUGGESTION: [improvement] at [file:line]Dengan workflow ini Copilot otomatis meng-comment PR dalam 1-2 menit setelah push, sehingga isu mekanis (error wrap, nil return, layer violation) tertangkap sebelum reviewer manusia membukanya. Efeknya, reviewer bisa fokus ke arsitektur dan business logic.
07.8 Copilot untuk Go-Specific Patterns
Copilot sangat kuat pada pola Go yang repetitif namun rawan typo. Contoh berikut menunjukkan Copilot melengkapi SQL placeholder, setup mock gomock untuk not-found, dan struct tags sesuai naming convention proyek.
1// Pattern 1: Copilot sangat bagus untuk generate SQL
2const insertOrder = `
3 INSERT INTO orders (id, user_id, status, total_amount, created_at)
4 VALUES ($1, $2, $3, $4, NOW())
5 RETURNING id, created_at
6`
7// Copilot auto-complete dengan correct $N placeholders
8
9// Pattern 2: Copilot generate mock setup
10func (s *CancelOrderSuite) TestCancelOrder_NotFound() {
11 s.mockRepo.EXPECT().
12 GetByIDAndUserID(gomock.Any(), gomock.Any(), gomock.Any()).
13 Return(nil, nil) // ← Copilot tahu return (nil, nil) untuk not-found
14
15 err := s.uc.Execute(context.Background(), CancelOrderInput{
16 OrderID: uuid.New(),
17 UserID: uuid.New(),
18 })
19
20 s.ErrorIs(err, domain.ErrOrderNotFound)
21}
22
23// Pattern 3: Copilot generate struct tags
24type OrderResponse struct {
25 ID string `json:"id" validate:"required,uuid"` // ← Copilot suggest tags
26 Status string `json:"status" validate:"oneof=PENDING CONFIRMED"`
27 TotalAmount int64 `json:"total_amount_idr"` // ← aware dengan naming convention
28 CreatedAt time.Time `json:"created_at"`
29}Yang menarik, Copilot menghormati konvensi yang kamu tetapkan di instructions — misalnya return nil, nil untuk not-found dan int64 untuk uang — sehingga pola Go yang benar direplikasi konsisten alih-alih idiom generik.
07.9 @workspace Queries yang Paling Berguna
@workspace berubah menjadi mesin pemahaman codebase saat kamu tahu pertanyaan yang tepat. Daftar query berikut mencakup discovery pola, cek konvensi, panduan integrasi, hingga validasi arsitektur.
1# Query 1: Pattern discovery
2@workspace How does this project handle concurrent access to order cancellation?
3# Copilot scan codebase, find SELECT FOR UPDATE atau mutex patterns, explain
4
5# Query 2: Convention check
6@workspace What error types are defined in the domain package and when to use each?
7# Copilot list all domain errors, show examples of usage
8
9# Query 3: Integration guidance
10@workspace I need to add a new Kafka consumer. What's the pattern used in this project?
11# Copilot show existing consumer code, explain the pattern
12
13# Query 4: Debugging assistance
14@workspace The TestCancelOrder_AtomicRollback test is failing. What are potential causes?
15# Copilot analyze test + implementation, suggest potential issues
16
17# Query 5: Architecture validation
18@workspace Is there any code that violates the clean architecture rules in this project?
19# Copilot scan for cross-layer imports, report violations
20
21# Query 6: Onboarding
22@workspace I'm new to this project. Give me an overview of how an order is created
23from HTTP request to database.
24# Copilot generate flow explanation untuk new developerQuery onboarding (nomor 6) sangat berharga untuk developer baru: alih-alih membaca ribuan baris kode buta, mereka mendapat peta alur dari HTTP hingga database dalam hitungan detik.
07.10 Copilot Enterprise: Fitur Tambahan untuk Tim Besar
Untuk organisasi besar, Copilot Enterprise menambahkan lapisan governance dan kustomisasi yang tidak ada di tier individual. Ringkasan berikut menyoroti fitur yang paling relevan untuk tim Go.
1GitHub Copilot Enterprise — fitur yang relevan untuk Go teams:
2
31. Custom model fine-tuned pada codebase kamu:
4 → Model yang "tahu" internal packages kamu
5 → Error types, naming conventions, patterns yang internal
6
72. Copilot Knowledge Bases:
8 → Index internal docs, architecture decision records
9 → Copilot bisa answer: "Kenapa kita tidak pakai X?"
10
113. Copilot in the CLI:
12 gh copilot suggest "cara run integration test"
13 gh copilot explain "git rebase --onto origin/main HEAD~3"
14
154. Advanced PR review:
16 → More context: full repository, not just diff
17 → Custom review policies per team
18
195. Enterprise compliance:
20 → Audit logs untuk semua Copilot usage
21 → No code training (data tidak dipakai untuk training model)
22 → IP indemnificationUntuk tim yang peduli data governance, poin compliance (audit logs, no training, IP indemnification) sering menjadi alasan tunggal memilih Copilot dibanding tool lain — bukan fitur codingnya.
07.11 Copilot Extension: Custom Integration
Copilot Extensions memungkinkan tim membangun tool kustom yang bisa dipanggil langsung dari Copilot Chat. Contoh berikut memperlihatkan extension untuk cek spec compliance dan menjalankan tooling Go internal.
1// Copilot Extensions memungkinkan custom tools di Copilot Chat
2
3// Contoh: extension untuk check spec compliance
4// @spec-check — check apakah PR memenuhi spec
5
6// Di Copilot Chat:
7// @spec-check Does the cancel order implementation in this PR
8// match the spec at .specify/features/cancel-order/spec.md?
9
10// Extension custom (Go service yang implement Copilot Extension API):
11// - Baca spec dari repo
12// - Analyze PR diff
13// - Compare ACs vs implementation
14// - Return compliance report
15
16// Extension for Go tooling:
17// @go-check Run go vet and golangci-lint on the changed files
18// → Extension jalankan tools, return hasil ke chatKarena extension ditulis sebagai service Go biasa, tim engineering bisa menyambungkan Copilot ke sistem internal (spec audit, linter kustom, Jira) — mengubahnya dari asisten umum menjadi asisten yang sadar proses internal perusahaan.
07.12 Copilot untuk Go Test Generation
Generate test adalah salah satu use case dengan ROI tertinggi. Cuplikan berikut merangkum tiga metode: /tests cepat, deskripsi behavior, dan generate langsung dari acceptance criteria spec.
1# Method 1: /tests command
2# Select function, run /tests
3/tests
4# Output: test cases berdasarkan function signature
5
6# Method 2: Describe behavior
7# Di Copilot Chat:
8"Generate unit tests untuk CancelOrderUseCase.Execute.
9Cover:
10- Happy path (PENDING dalam 30 menit)
11- Not found (return nil, nil dari repo)
12- Status bukan PENDING
13- Window expired (> 30 menit)
14- Concurrent cancel (optimistic lock scenario)
15
16Gunakan testify/suite + gomock pattern dari existing tests di project ini."
17
18# Method 3: From spec
19"Generate tests yang cover semua ACs dari spec ini:
20AC1: Cancel order PENDING dalam 30 menit → success
21AC2: Cancel order CONFIRMED → 409 ORDER_NOT_CANCELLABLE
22AC3: Cancel window expired → 409 CANCEL_WINDOW_EXPIRED
23
24Pattern yang harus digunakan: @file internal/usecase/order/create_order_test.go"Metode ketiga (from spec) adalah yang paling selaras dengan SDD: kamu memberi Copilot daftar AC eksplisit, sehingga test yang dihasilkan bisa di-trace langsung ke kriteria penerimaan, bukan tebakan behavior.
07.13 Workflow Harian dengan Copilot untuk Go Developer
Agar terasa konkret, mari lihat bagaimana Copilot menyatu dalam satu hari kerja Go developer. Alur berikut memetakan pemakaian dari planning pagi hingga PR review otomatis.
1Morning: Review tasks + plan
2 Copilot Chat: "@workspace Apa dependencies dari Cancel Order feature?"
3
4Coding (bulk):
5 → Inline completions untuk error handling, SQL, struct tags
6 → Sangat smooth, tidak perlu switch context
7
8Stuck point:
9 Copilot Chat: "/explain fungsi ini"
10 Copilot Chat: "@workspace Bagaimana pattern untuk [specific thing]?"
11
12Implement feature:
13 Copilot Chat: "Implement method ini sesuai spec: @specs/order/cancel-order.md (AC1-AC10, EC1-EC4)
14 Ikuti pattern dari @file existing-feature.go"
15
16Before PR:
17 Copilot Chat: "Review perubahan saya untuk error/architecture violations"
18
19PR submitted:
20 → Copilot auto-review via GitHub Actions (07.7)
21 → Human reviewer hanya review architecture + business logicPola ini menunjukkan sweet spot Copilot: ia mengisi celah antar-langkah tanpa memaksa developer keluar dari editor atau browser GitHub, sehingga friksi context switching mendekati nol.
07.14 Kekuatan dan Kelemahan: Summary untuk Go
Sebelum memutuskan, penting menimbang secara jujur di mana Copilot unggul dan di mana ia tertinggal untuk pekerjaan Go.
Kekuatan:
- Inline completions paling smooth — tidak ada context switch, terasa natural saat typing
- @workspace context — Copilot yang “tahu” seluruh repo memberi answer yang sangat relevant
- PR review automation — game changer untuk quality dan review velocity tim
- GitHub native integration — Issue → Plan → PR flow yang seamless
- Enterprise compliance — data governance kuat, no training on your code
- Low friction adoption — developer langsung produktif tanpa learning curve curam
Kelemahan:
- Agent mode masih kurang powerful — autonomous task terbatas dibanding Claude Code atau Cursor
- Context retention antar session — tidak se-persistent CLAUDE.md di Claude Code
- Tidak bisa run commands — tidak bisa
go testotomatis seperti Claude Code - Go idiom quality — adequate tapi tidak se-consistent Claude Code untuk pola kompleks
- No spec-first workflow — tidak ada built-in SDD support
Kesimpulan seimbangnya: Copilot menang di kelancaran dan integrasi GitHub, tapi menyerahkan mahkota untuk reasoning kompleks dan disiplin spec-first ke tool lain.
07.15 Kapan Copilot adalah Pilihan Terbaik untuk Go
Keputusan memilih Copilot sebaiknya berbasis konteks tim, bukan hype. Checklist berikut memetakan kondisi di mana Copilot menang dan kapan sebaiknya beralih ke tool lain.
1Pilih GitHub Copilot jika:
2
3✅ Tim heavily invested di GitHub (Actions, Projects, dll.)
4✅ Butuh PR review automation yang reliable
5✅ Tim heterogeneous (senior + junior) — inline smooth + /explain
6✅ Enterprise compliance adalah requirement (SOC2, audit logs)
7✅ Budget: $10/dev (individual) atau $19 (business)
8✅ Issue-driven development adalah workflow inti
9
10❌ Jangan pilih Copilot jika:
11 → SDD workflow adalah prioritas (pakai Claude Code + Spec Kit)
12 → Butuh autonomous complex tasks (pakai Claude Code)
13 → Go idiom quality adalah standar tertinggi non-negotiable (Claude Code)Aturan praktisnya: kalau alur kerja tim berpusat di GitHub dan butuh review otomatis yang murah, Copilot hampir selalu pilihan tepat; kalau prioritasnya spec-first dan reasoning mendalam, tool lain lebih pas.
07.16 Copilot di CI/CD untuk Go
Copilot bisa berdampingan dengan pipeline Go standar tanpa menggantikan gate deterministik. Konfigurasi berikut memisahkan stage Go standar (build, test, vet, lint) dari stage review AI.
1# .github/workflows/go-ci-with-copilot.yml
2name: Go CI + Copilot
3
4on: [push, pull_request]
5
6jobs:
7 # Stage 1: Standard Go checks (no AI)
8 go-standard:
9 runs-on: ubuntu-latest
10 steps:
11 - uses: actions/checkout@v4
12 - uses: actions/setup-go@v5
13 with:
14 go-version: '1.22'
15 - run: go build ./...
16 - run: go test -race ./...
17 - run: go vet ./...
18 - uses: golangci/golangci-lint-action@v6
19
20 # Stage 2: Copilot PR Review (AI-powered)
21 copilot-review:
22 runs-on: ubuntu-latest
23 if: github.event_name == 'pull_request'
24 permissions:
25 pull-requests: write
26 contents: read
27 steps:
28 - uses: actions/checkout@v4
29 - name: Copilot Code Review
30 uses: github/copilot-for-pull-requests@v1
31 with:
32 github-token: ${{ secrets.GITHUB_TOKEN }}
33 review-instructions: |
34 [custom instructions dari 07.7]Pemisahan dua stage ini penting: gate deterministik (build/test/vet/lint) tetap menjadi sumber kebenaran yang tidak boleh gagal, sementara Copilot review bertindak sebagai lapisan saran tambahan — bukan penentu merge.
07.17 Benchmark: Copilot di Berbagai Aspek
Untuk menempatkan Copilot secara objektif, kami menjalankan lima skenario benchmark di Santekno Shop. Angka berikut merangkum skor keseluruhan dan per skenario.
1Copilot performance di Santekno Shop benchmark:
2
3Overall: 80.2/100
4
5By scenario:
6 S1 (Implement dari spec): 82/100
7 S2 (Write unit tests): 78/100
8 S3 (Refactoring): 79/100
9 S4 (Debug race condition): 82/100
10 S5 (OpenAPI gen): 80/100
11
12Where Copilot stands out vs others:
13 PR review quality: ⭐⭐⭐⭐⭐ (best of all tools)
14 Inline suggestion smoothness: ⭐⭐⭐⭐⭐ (best of all tools)
15 GitHub integration: ⭐⭐⭐⭐⭐ (obvious)
16
17Where Copilot lags:
18 Go idiom correctness: ⭐⭐⭐ (vs Claude Code ⭐⭐⭐⭐⭐)
19 Complex reasoning: ⭐⭐⭐ (vs Claude Code ⭐⭐⭐⭐⭐)
20 Context retention: ⭐⭐⭐ (vs Claude Code ⭐⭐⭐⭐⭐)Skor 80,2 menegaskan profil Copilot: solid dan konsisten di semua skenario, dengan keunggulan tajam di PR review dan kelancaran inline, tapi tertinggal jelas pada reasoning kompleks.
07.18 Tips & Gotchas
Beberapa pelajaran lapangan berikut membantu kamu memaksimalkan Copilot sekaligus menghindari jebakan umum.
💡 Tip 1: Gunakan @workspace sering — ini mengubah Copilot dari generic AI ke project-aware AI. Pertanyaan seperti “@workspace how does error propagation work here?” mengembalikan jawaban berbasis kode aktualmu.
💡 Tip 2: Custom instructions yang detail — copilot-instructions.md yang baik adalah kunci. Sertakan exact error patterns, package paths, dan contoh kode.
💡 Tip 3: Tab completion dengan selektif — jangan selalu Tab untuk accept. Baca setiap suggestion; Copilot kadang menyarankan yang melanggar konvensi error handling kamu.
💡 Tip 4: Combine dengan Claude Code untuk complex tasks — Copilot untuk daily inline + PR review, Claude Code untuk complex feature planning dan debugging.
⚠️ Gotcha 1: Inline yang terlalu agresif — terlalu cepat Tab = kode salah masuk tanpa review. Baca sebelum accept.
⚠️ Gotcha 2: @workspace lambat untuk large repo — untuk repo > 50K baris bisa butuh 10-30 detik. Gunakan untuk riset, bukan untuk flow typing real-time.
⚠️ Gotcha 3: PR review timing — review berjalan di GitHub Actions, butuh 1-5 menit setelah push. Bukan instant.
⚠️ Gotcha 4: Copilot Instructions bersifat publik — .github/copilot-instructions.md adalah file publik di repo. Jangan masukkan detail arsitektur sensitif.
Benang merah semua tip ini: Copilot adalah amplifier, bukan autopilot — hasil terbaik datang saat kamu tetap membaca, memverifikasi, dan mengarahkannya lewat instructions yang tajam.
07.19 Integrasi dengan Spec Kit
Copilot bisa dijadikan eksekutor perbaikan atas laporan audit Spec Kit dari topik sebelumnya. Cuplikan berikut menunjukkan cara memberi Copilot report audit dan memintanya mengimplementasikan fix berdasarkan prioritas.
1# Setelah specify audit generate report:
2# specify audit --feature cancel-order --output markdown > audit-report.md
3
4# Di Copilot Chat:
5"Baca audit report ini dan implement fixes untuk semua CRITICAL issues:
6@audit-report.md
7
8Prioritaskan:
91. Missing AC implementations
102. Architecture violations
113. Missing test coverage"
12
13# Copilot akan implement fixes berdasarkan audit report
14# Kemudian: specify audit lagi untuk verify score naikPola ini menempatkan Spec Kit sebagai “juri” dan Copilot sebagai “pelaksana”: audit menghasilkan daftar temuan terstruktur, Copilot mengeksekusinya, lalu audit ulang memverifikasi skor naik — loop perbaikan yang terukur.
07.20 GitHub Copilot: Roadmap 2026-2027
Karena landscape bergerak cepat, ada baiknya memahami arah pengembangan Copilot. Ringkasan berikut memisahkan fitur yang sudah tersedia di 2026 dari yang masih ditunggu.
1Features yang sudah available (2026):
2✅ Copilot in GitHub Mobile
3✅ Copilot Workspace (Issue → PR)
4✅ Copilot Extensions API (build custom tools)
5✅ Copilot in CLI (gh copilot suggest/explain)
6✅ Fine-tuned custom model (Enterprise)
7
8Expected development:
9🔜 Better agent mode (more autonomous tasks)
10🔜 Deeper IDE integration (tidak hanya VS Code)
11🔜 Copilot for GitHub Projects (planning assistance)
12🔜 Multi-model support (pilih model per task)
13🔜 Better Go-specific training dataUntuk Go developer, dua item yang paling ditunggu adalah agent mode yang lebih kuat dan multi-model support — begitu keduanya matang, sebagian kelemahan Copilot di reasoning kompleks bisa terkikis.
07.21 Integrasi dengan Seluruh GitHub Workflow
Keunikan Copilot yang sebenarnya adalah kehadirannya di setiap titik sentuh GitHub. Perjalanan developer berikut memperlihatkan bagaimana Copilot menemani tiap tahap tanpa perlu berganti tool.
1Developer Journey dengan Copilot:
2
31. Planning
4 GitHub Issues → Copilot Workspace ("Buat plan untuk ini")
52. Development
6 VS Code → Copilot inline + Chat
73. Pre-PR
8 Copilot Chat → "Review changes saya"
94. PR submission
10 GitHub → Copilot auto-review (Actions)
115. Code review discussion
12 GitHub PR comments → Copilot suggestions
136. Merge & deployment
14 GitHub Actions → Copilot for CI issues
157. Post-deployment
16 GitHub Issues (bug reports) → Copilot Workspace
17
18Every step covered. No tool switching needed.Untuk tim yang 100% GitHub, keterpaduan ini adalah keunggulan kompetitif nyata dibanding tool yang hanya menyentuh satu-dua tahap — nilainya bersifat compounding seiring makin dalamnya adopsi GitHub.
07.22 Analisis Mendalam: Mengapa PR Review adalah Differentiator Nyata
Banyak developer meremehkan berapa besar waktu review yang habis untuk isu mekanis yang seharusnya bisa ditangkap otomatis. Data dari satu tim Go berikut memperlihatkan dampak Copilot PR review pada distribusi waktu review.
1Data dari tim 5 developer Go:
2
3SEBELUM Copilot PR Review (3 bulan baseline):
4 PR review time average: 47 menit per PR
5 Architecture & logic review: 25 menit (53%)
6 Error handling check: 8 menit (17%)
7 Import & type correctness: 6 menit (13%)
8 Test coverage check: 5 menit (11%)
9 Formatting & style: 3 menit ( 6%)
10
11SESUDAH Copilot PR Review (3 bulan):
12 PR review time average: 31 menit per PR (34% reduction)
13 Architecture & logic review: 25 menit (80%) ← fokus di sini
14 Error handling check: 2 menit ( 6%) ← Copilot handled most
15 Import & type correctness: 1 menit ( 3%) ← Copilot handled most
16 Test coverage check: 2 menit ( 6%) ← Copilot flagged gaps
17 Formatting & style: 1 menit ( 3%) ← minimalInsight kuncinya: total waktu review turun 34%, tapi yang lebih penting, porsi waktu untuk architecture dan logic — yang memang butuh judgment manusia — justru meningkat. Pekerjaan mekanis di-delegasikan ke Copilot, senior developer fokus ke yang bernilai tinggi.
07.23 Copilot dan Go Generics: Seberapa Baik?
Generics (Go 1.18+) adalah area yang relatif baru dan sering jadi tolok ukur kematangan tool. Contoh berikut menguji Copilot membuat interface repository generik dan alias konkretnya.
1// Prompt: Generate generic repository interface untuk Santekno Shop
2
3// Copilot suggest:
4type Repository[T any, ID any] interface {
5 Create(ctx context.Context, entity T) error
6 GetByID(ctx context.Context, id ID) (*T, error)
7 Update(ctx context.Context, entity T) error
8 Delete(ctx context.Context, id ID) error
9}
10
11// Concrete implementation:
12type OrderRepository = Repository[domain.Order, uuid.UUID]
13type ProductRepository = Repository[domain.Product, uuid.UUID]
14
15// Verdict: Copilot handle basic generics dengan baik.
16// Untuk complex generic constraints (comparable, interface constraints),
17// masih perlu manual guidance. Claude Code lebih baik untuk complex generics.Kesimpulannya, Copilot mumpuni untuk generics dasar seperti interface repository, tapi begitu constraint menjadi kompleks (misalnya comparable atau interface constraint berlapis), kamu masih perlu mengarahkannya secara manual.
07.24 Membandingkan copilot-instructions.md vs CLAUDE.md
Karena keduanya berperan sebagai project memory, wajar membandingkan efektivitasnya. Tabel berikut merangkum hasil pengujian dengan skenario yang sama pada beberapa dimensi.
1Dimensi | copilot-instructions | CLAUDE.md
2────────────────────┼──────────────────────┼──────────────────
3Retention (session) | Moderate (7/10) | High (9/10)
4Code block examples | Very effective | Very effective
5NEVER list | Effective | Very effective
6Architecture rules | Moderate | High
7Layer separation | Moderate | High
8Custom types | Effective | Very effective
9Long session | Degrades to 5/10 | Stays at 8/10Temuan utamanya: untuk sesi panjang (>30 exchange), retensi CLAUDE.md jauh lebih konsisten. Implikasinya jelas — pakai Copilot untuk task yang selesai dalam beberapa exchange, dan andalkan Claude Code untuk sesi autonomous yang panjang.
07.25 Checklist Adopsi GitHub Copilot untuk Go Team
Agar adopsi terarah, gunakan checklist bertahap berikut. Ia membagi rollout menjadi fase setup, familiarization, optimization, hingga evaluasi bulan kedua.
1Setup phase:
2□ Install VS Code extension (GitHub.copilot + GitHub.copilot-chat)
3□ Setup .github/copilot-instructions.md dengan Go conventions
4□ Enable Copilot in repository settings
5□ Setup PR review automation (07.7)
6□ Demo session untuk seluruh tim (45 menit)
7
8Day 1-7 (familiarization):
9□ Gunakan inline completions untuk daily coding
10□ Eksplorasi /explain dan /tests commands
11□ Coba @workspace untuk project-specific questions
12
13Day 8-30 (optimization):
14□ Refine copilot-instructions.md berdasarkan output
15□ Setup PR review automation di semua relevant repos
16□ Combine dengan Claude Code untuk complex tasks
17
18Month 2:
19□ Track: PR review comment count (should decrease)
20□ Track: Time dari spec ke PR ready (should decrease)
21□ Evaluate: apakah worth upgrade ke Business tier?Kunci sukses checklist ini adalah metrik di bulan kedua: jika jumlah comment review dan waktu spec-ke-PR menurun, adopsi Copilot terbukti membayar dirinya sendiri — bukan sekadar terasa “keren”.
07.26 Ringkasan
GitHub Copilot adalah pilihan terbaik untuk tim Go yang heavily invested di GitHub ecosystem, butuh PR review automation yang reliable, dan ingin AI yang smooth tanpa mengubah workflow secara drastis.
Key strengths: Inline completions paling smooth, PR review automation terbaik, @workspace context, GitHub native integration.
Key weaknesses: Agent mode terbatas, Go idiom quality tidak se-consistent Claude Code, tidak ada built-in SDD workflow.
Best strategy: GitHub Copilot sebagai primary ($10-19/dev), dikombinasikan dengan Claude Code untuk complex feature development dan deep debugging.
Di artikel berikutnya, kita beralih ke tool dengan filosofi yang berseberangan: AWS Kiro — IDE yang memaksa spec-first by design, di mana kamu tidak seharusnya menulis kode tanpa spesifikasi tertulis yang jelas.