Skip to content

Make parser output order stable #194

Open

Description

@Yogeb-tech

Overview

In cometCalendarParser.go and mazevoParser.go, the final result slice is built by ranging over maps. In Go, map iteration order is random, so the order of dates, buildings, and rooms in the output JSON changes every run. This makes the output hard to unit test, and hard to differentiate change on consecutive runs. Sort the dates, buildings, and rooms before appending them to result. Use sort.Strings or slices.Sort for each level of the map before you build the slices.

Resources

https://pkg.go.dev/slices#Sort
https://pkg.go.dev/sort#Strings

Activity

  1. linked a pull request that will close this issueFixed Issue #194 #209on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

L1A task suitable for someone who is comfortable helping with basic issues.recommended for recruits

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions