File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ package tree
1616
1717import (
1818 "fmt"
19+ "sort"
1920 "strings"
2021)
2122
@@ -300,15 +301,21 @@ func (node *Limit) Format(ctx *FmtCtx) {
300301 ctx .WriteByte (' ' )
301302 }
302303 ctx .WriteString ("with option " )
304+ // Sort keys to ensure deterministic output order
305+ keys := make ([]string , 0 , len (node .Option ))
306+ for key := range node .Option {
307+ keys = append (keys , key )
308+ }
309+ sort .Strings (keys )
303310 first := true
304- for key , value := range node . Option {
311+ for _ , key := range keys {
305312 if ! first {
306313 ctx .WriteString (", " )
307314 }
308315 ctx .WriteString ("'" )
309316 ctx .WriteString (key )
310317 ctx .WriteString ("=" )
311- ctx .WriteString (value )
318+ ctx .WriteString (node . Option [ key ] )
312319 ctx .WriteString ("'" )
313320 first = false
314321 }
You can’t perform that action at this time.
0 commit comments