Browse code

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 authored on 2013/03/27 07:30:16
Showing 1 changed files
... ...
@@ -6,6 +6,7 @@ import (
6 6
 	"io/ioutil"
7 7
 	"os"
8 8
 	"path/filepath"
9
+	"sort"
9 10
 	"strings"
10 11
 )
11 12
 
... ...
@@ -94,6 +95,7 @@ func (store *TagStore) ById() map[string][]string {
94 94
 				byId[id] = []string{name}
95 95
 			} else {
96 96
 				byId[id] = append(byId[id], name)
97
+				sort.Strings(byId[id])
97 98
 			}
98 99
 		}
99 100
 	}