From bc62da24a3beefe02817573263ff195d847ad83d Mon Sep 17 00:00:00 2001 From: Didier Roche Date: Wed, 26 Jul 2023 16:44:50 +0200 Subject: [PATCH] Order locations in ascii order As in the pkg-tree implementation, the walking of different dependencies are not determinated, this means that we may have references swapping between consecutive runs. Ensure we always order them the same way now. --- cli/xgotext/parser/domain.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/xgotext/parser/domain.go b/cli/xgotext/parser/domain.go index 55ff4a5..45e913e 100644 --- a/cli/xgotext/parser/domain.go +++ b/cli/xgotext/parser/domain.go @@ -29,7 +29,9 @@ func (t *Translation) AddLocations(locations []string) { func (t *Translation) Dump() string { data := make([]string, 0, len(t.SourceLocations)+5) - for _, location := range t.SourceLocations { + locations := t.SourceLocations + sort.Strings(locations) + for _, location := range locations { data = append(data, "#: "+location) }