Skip to content

Commit

Permalink
encoder: make deterministic
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverpool authored and emersion committed Oct 24, 2024
1 parent 2bb40be commit c9703dd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,13 @@ func formatLine(key string, field *Field) string {
}
s += key

for pk, pvs := range field.Params {
for _, pv := range pvs {
var keys []string
for k := range field.Params {
keys = append(keys, k)
}
sort.Strings(keys)
for _, pk := range keys {
for _, pv := range field.Params[pk] {
s += ";" + formatParam(pk, pv)
}
}
Expand Down

0 comments on commit c9703dd

Please sign in to comment.