فهرست منبع

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 12 سال پیش
والد
کامیت
846a9e8963
1فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  1. 2 0
      tags.go

+ 2 - 0
tags.go

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