Day 007 — Week 1 Review Day¶
Month 1 · Week 1 · ⬅ Day 006 · Day 008 ➡ · Journal index
📋 Full structured review:
week-1-review.md
🎯 Learning Objective¶
Consolidate Week 1 via closed-book recall and clean up the week's code.
📚 Topics¶
- Recap: toolchain, variables/constants/iota, types & conversions, control flow, functions/defer, packages/modules.
📝 Notes¶
- Re-ran every example with
go run; rango test ./...(mathutil + exercises all green). - Ran
gofmt -l .andgo vet ./...— fixed formatting; no vet issues. - Redid FizzBuzz from memory (active recall) without looking — passed on the first try.
🧠 Closed-Book Recall (Week 1)¶
- Q: Three ways to declare a variable?
A
var x T = v,var x = v(inferred),x := v(short, functions only). - Q: What is
iotaand a common use?A
A per-const-block counter from 0; used for enums and1 << iotabit flags. - Q: Why is
string(65)not"65"?A
It converts an int to a rune/code point →"A". Usestrconv.Itoa. - Q: Bytes vs runes in
len("héllo")?A
len= 6 bytes; 5 runes. - Q: Does
switchfall through by default?A
No. - Q:
deferorder and arg-evaluation timing?A
LIFO; args evaluated at thedeferline. - Q: How is visibility controlled across packages?
A
Capitalized identifier = exported; lowercase = package-private.
🐛 Mistakes / Themes This Week¶
- The
string(int)trap (Day 003). - FizzBuzz case ordering (Day 004).
- Exported vs unexported naming (Day 006).
🪶 Feynman Reflection¶
I can now read and write basic Go programs: declare data, branch and loop, factor logic into functions, and package it for reuse — and prove it with tests.
🕳️ Knowledge Gaps Carried Forward¶
- Slice internals (next week's headline topic).
- panic/recover depth (Week 3).
✅ Summary¶
Week 1 fundamentals consolidated; all code formatted, vetted, and tested. Confidence on syntax now ⅘.
⏭️ Next Steps¶
- Week 2: composite types — arrays, slices (internals!), maps, strings, structs.
| Time spent | Difficulty | Confidence |
|---|---|---|
| 75 min | 🟦⬜⬜⬜⬜ | 🟦🟦🟦🟦⬜ |
Suggested commit: docs(journal): week 1 review (day 007)