From 268befa435bd7409b5192ffde06767da27440cb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Budai?= Date: Thu, 28 Nov 2019 08:31:06 +0100 Subject: [PATCH] store: make ListQueue return value more predictable by sorting it The return value hasn't been predictable prior to this commit. This is probably caused by internal implementation of Golang map. This commit fixes it by sorting the output. --- internal/store/store.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/store/store.go b/internal/store/store.go index 5950b835f..73d04e005 100644 --- a/internal/store/store.go +++ b/internal/store/store.go @@ -305,6 +305,11 @@ func (s *Store) ListQueue(uuids []uuid.UUID) []*ComposeEntry { } } + // make this function output more predictable + sort.Slice(composes, func(i, j int) bool { + return composes[i].ID.String() < composes[j].ID.String() + }) + return composes }