Keep tags on their tubs
Repair the stock-record editor: apply deliveries to the retained records, locate an exact requested name-and-quantity value, then maintain durable IDs across removal, sale and insertion.
What needs to change
Repair run so every tag stays on its own tub.
Reproduce
- Pipe the sample commands into go run main.go and compare the tag lines and the final stall.
Acceptance criteria
Your review marks · Saved in this browser. Test acceptance is tracked separately.
Notes
The file contains its imports, readLines, the Tub type and the complete main.
Input: up to 100 commands: "add NAME KG", "sell TAG KG" or "remove TAG". Names are single words, KG is a whole number from 0 to 100 and TAG is a positive integer up to 100. Sales may leave a negative recorded balance. Unknown tags are ignored; the supplied reader receives valid data.