Courses
Go for Beginners: Write Reliable Programs and Small Services
Check Yourself
Five scenario questions on JSON struct tags, HTTP status codes, httptest, and static binaries.
Course content
Join this Course
Sign in to save your progress.
-
Before You Write Code
-
Why Go Exists and When to Pick It
-
Run Your First Go Program
-
-
-
Values, Control Flow, and Functions
-
Variables, Types, and Zero Values
-
If, For Loops, and Multiple Return Values
-
-
-
Slices, Maps, and Structs
-
Arrays, Slices, and Why append Matters
-
Maps, Structs, and Pointer Receivers
-
-
-
Errors, Packages, and Testing
-
Handle Errors Without Hiding Them
-
Packages, Exports, and go test
-
-
-
Files, JSON, and a Small HTTP Server
-
Read Files and Decode JSON Structs
-
Build and Test a Small net/http Server
-
-
-
Pointers, Modules, and CLIs
-
Pointers and Memory Basics
-
Managing Dependencies and internal/ Packages
-
Building CLIs With flag, os.Getenv, and Exit Codes
-
-
1.
You define `type Config struct { port int `json:"port"` }` and run `json.Unmarshal(raw, &cfg)`. Why does `cfg.port` stay 0?
2.
When is `os.ReadFile` a poor choice?
3.
In an HTTP handler, you call `w.WriteHeader(http.StatusOK)` and then `w.Header().Set("Content-Type", "application/json")`. What happens?
4.
Why does splitting `newMux()` out of `main()` make HTTP tests fast and reliable?
5.
What does `CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o status-server .` produce for Linux?
About
Five scenario questions on JSON struct tags, HTTP status codes, httptest, and static binaries.
- Duration
- 5 min
- Last update
- 11/27/2026
Was this helpful?
0
0
Comments
Sign in to commentNo comments yet.