Courses
Go Intermediate: Interfaces, Concurrency, and Services
Check Yourself
Five questions on Go generics, SQL transactions, timer leaks, and test fixtures.
By Jay P
Updated
5 min
GoAPIs and IntegrationsTesting and DebuggingProgramming Patterns
Intermediate
Course content
Join this Course
Sign in to save your progress.
-
Interfaces and Standard Abstractions
-
Interfaces Are Satisfied Implicitly
-
Read and Stream With io.Reader and io.Writer
-
-
-
Context, Timeouts, and Cancellation
-
Use context.Context for Deadlines and Cancellation
-
Set Timeouts on HTTP Clients and Server Handlers
-
-
-
Goroutines, Channels, and Coordination
-
Run Concurrent Work Safely With sync.WaitGroup
-
Coordinate Pipelines and Timeouts With Channels and select
-
-
-
Structured Logging and Databases
-
Write Structured JSON Logs With log/slog
-
Query Relational Data Safely With database/sql
-
-
-
Middleware and Production-Ready Services
-
Wrap HTTP Handlers With Middleware
-
Build a Multi-Route Service With Graceful Shutdown
-
-
-
Generics, Transactions, Timers, and Test Doubles
-
Generics, Constraints, and slices/maps Packages
-
SQL Transactions and Connection Pool Limits
-
Timers, Tickers, and Avoiding time.After Leaks
-
Testing With Interface Fakes, t.TempDir, and testdata
-
-
1.
Which built-in constraint allows `<` and `>` comparisons in a generic Go function?
2.
Why is `defer tx.Rollback()` safe right after `tx, err := db.BeginTx(ctx, nil)` even if `tx.Commit()` succeeds?
3.
Why should you avoid calling `time.After(5 * time.Second)` inside a hot `for { select { ... } }` loop?
4.
What does `t.TempDir()` provide inside a Go test?
5.
How does `go build` treat a directory named `testdata/`?
About
Five questions on Go generics, SQL transactions, timer leaks, and test fixtures.
- Duration
- 5 min
- Last update
- 11/27/2026
Was this helpful?
0
0
Comments
Sign in to commentNo comments yet.