qmuntal / stateless

Go library for creating finite state machines
BSD 2-Clause "Simplified" License
898 stars 47 forks source link

Ensure generated DOT file doesn't change unless state machine changes #40

Closed cezarsa closed 2 years ago

cezarsa commented 2 years ago

By using slices and sorting them by state and trigger values we ensure that ToGraph() will always return the same output for the same state machine.

This is important in situations where ToGraph() is used to generate a file that's committed to a repository to ensure it doesn't change on every commit.

qmuntal commented 2 years ago

Thanks for this contribution