Skip to content

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; ran go test ./... (mathutil + exercises all green).
  • Ran gofmt -l . and go vet ./... — fixed formatting; no vet issues.
  • Redid FizzBuzz from memory (active recall) without looking — passed on the first try.

🧠 Closed-Book Recall (Week 1)

  1. Q: Three ways to declare a variable?
    Avar x T = v, var x = v (inferred), x := v (short, functions only).
  2. Q: What is iota and a common use?
    AA per-const-block counter from 0; used for enums and 1 << iota bit flags.
  3. Q: Why is string(65) not "65"?
    AIt converts an int to a rune/code point → "A". Use strconv.Itoa.
  4. Q: Bytes vs runes in len("héllo")?
    Alen = 6 bytes; 5 runes.
  5. Q: Does switch fall through by default?
    ANo.
  6. Q: defer order and arg-evaluation timing?
    ALIFO; args evaluated at the defer line.
  7. Q: How is visibility controlled across packages?
    ACapitalized 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)