Prototype: AddValue(current MeterSnapshot,delta int) (MeterSnapshot,error) requires delta>=0; returns copied snapshot with Total increased, preserving caller. Negative delta returns error and zero snapshot. Label is not validated in this prototype.
Final: NewMeter(label string) (*Meter,error) requires nonempty label, starts total zero. (*Meter).Add(delta int) (int,error) requires nonnegative delta, returns new total; errors preserve state. Reset() int returns previous total and resets to zero, keeping label. Snapshot() MeterSnapshot detached scalar value. Empty label remains invalid even though Total's zero is useful. Arithmetic fits int. Instances independent; no concurrent access required.
Edit exercise.go; retain the public types and signatures. prototype and final are separate stages. The executable tests recover panics as failures, report named checks, and exit nonzero on any failure. A successful run must execute at least one check. Tests use logical time or explicit synchronization where relevant.
Complete the starter code, then run the checks.
Results and errors will appear here.