Ver Fonte

When doing a reverse-lookup of an image's tag, if the image has multiple tags, the first tag in alphabetical order will be used

Solomon Hykes há 12 anos atrás
pai
commit
846a9e8963
1 ficheiros alterados com 2 adições e 0 exclusões
  1. 2 0
      tags.go

+ 2 - 0
tags.go

@@ -6,6 +6,7 @@ import (
 	"io/ioutil"
 	"os"
 	"path/filepath"
+	"sort"
 	"strings"
 )
 
@@ -94,6 +95,7 @@ func (store *TagStore) ById() map[string][]string {
 				byId[id] = []string{name}
 			} else {
 				byId[id] = append(byId[id], name)
+				sort.Strings(byId[id])
 			}
 		}
 	}