Homework

Homework — your library

YOUR app becomes a library — the second of three milestones (runs ✓ → holds many → saves).

Requirements:

  1. var items []Item — the app holds many of your records.
  2. Add — builds a record from input (with lesson 6's number validation) and appends it.
  3. List — all records numbered from 1; an empty list gets a friendly message.
  4. An edit branch by number (mark/change) — with a bounds check, mutation through items[i].
  5. Port your lesson-6 numeric branches so they work on a chosen record.
  6. gofmt + a working transcript.

To submit: the code + a transcript: empty list → 3 records → an edit → the list showing the change.

Tip. Look back at your main — after five lessons of growth it got long: branches carry 10 lines of logic each, some function names no longer match their jobs. Does it work? Yes. Is it clean? Not really. The next lesson is short but mandatory: code culture (gofmt, go vet, naming, doc comments) — so your library looks like a professional's, not a rough draft.