Code RoomParse error ignored, validation proceeds
MediumPrep Room Coding #2128

Parse error ignored, validation proceeds

Code reviewCode quality & reviewMid–Senior~15 min

Review this Go function that loads, validates, and saves a config.

What a strong answer looks like

Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix, specific and kind.

0:00 of about 15 min
Mark a line and say what kind of problem it is.0 findings
1func updateConfig(raw []byte) error {
2 cfg, err := parse(raw)
3 if err != nil {
4 log.Printf("parse failed: %v", err)
5 }
6 if err := validate(cfg); err != nil {
7 return err
8 }
9 save(cfg)
10 return nil
11}
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.