| ... | ... |
@@ -366,7 +366,7 @@ |
| 366 | 366 |
"ImportPath": "github.com/elazarl/go-bindata-assetfs", |
| 367 | 367 |
"Rev": "4e003f5e7162b67b84ea0f6117218f9c6f8fd2df" |
| 368 | 368 |
}, |
| 369 |
- {
|
|
| 369 |
+ {
|
|
| 370 | 370 |
"ImportPath": "github.com/fsouza/go-dockerclient", |
| 371 | 371 |
"Comment": "0.2.1-241-g0dbb508", |
| 372 | 372 |
"Rev": "0dbb508e94dd899a6743d035d8f249c7634d26da" |
| ... | ... |
@@ -392,9 +392,9 @@ |
| 392 | 392 |
}, |
| 393 | 393 |
{
|
| 394 | 394 |
"ImportPath": "github.com/jteeuwen/go-bindata", |
| 395 |
- "Comment": "v3.0.5-31-g93b909d", |
|
| 396 |
- "Rev": "93b909d1499a38620121b0a5eb43a18f3bccb083" |
|
| 397 |
- }, |
|
| 395 |
+ "Comment": "v3.0.6", |
|
| 396 |
+ "Rev": "1743f47c0112eff669b0199889670d61384b4730" |
|
| 397 |
+ }, |
|
| 398 | 398 |
{
|
| 399 | 399 |
"ImportPath": "github.com/google/gofuzz", |
| 400 | 400 |
"Rev": "aef70dacbc78771e35beb261bb3a72986adf7906" |
| ... | ... |
@@ -10,3 +10,10 @@ type Asset struct {
|
| 10 | 10 |
Name string // Key used in TOC -- name by which asset is referenced. |
| 11 | 11 |
Func string // Function name for the procedure returning the asset contents. |
| 12 | 12 |
} |
| 13 |
+ |
|
| 14 |
+// Implement sort.Interface for []Asset based on Path field |
|
| 15 |
+type ByPath []Asset |
|
| 16 |
+ |
|
| 17 |
+func (v ByPath) Len() int { return len(v) }
|
|
| 18 |
+func (v ByPath) Swap(i, j int) { v[i], v[j] = v[j], v[i] }
|
|
| 19 |
+func (v ByPath) Less(i, j int) bool { return v[i].Path < v[j].Path }
|
| ... | ... |
@@ -10,6 +10,7 @@ import ( |
| 10 | 10 |
"os" |
| 11 | 11 |
"path/filepath" |
| 12 | 12 |
"regexp" |
| 13 |
+ "sort" |
|
| 13 | 14 |
"strings" |
| 14 | 15 |
"unicode" |
| 15 | 16 |
) |
| ... | ... |
@@ -34,6 +35,9 @@ func Translate(c *Config) error {
|
| 34 | 34 |
} |
| 35 | 35 |
} |
| 36 | 36 |
|
| 37 |
+ // Sort to make output stable between invocations |
|
| 38 |
+ sort.Sort(ByPath(toc)) |
|
| 39 |
+ |
|
| 37 | 40 |
// Create output file. |
| 38 | 41 |
fd, err := os.Create(c.Output) |
| 39 | 42 |
if err != nil {
|
| ... | ... |
@@ -8,6 +8,7 @@ import ( |
| 8 | 8 |
"fmt" |
| 9 | 9 |
"io" |
| 10 | 10 |
"os" |
| 11 |
+ "sort" |
|
| 11 | 12 |
"strings" |
| 12 | 13 |
) |
| 13 | 14 |
|
| ... | ... |
@@ -54,10 +55,20 @@ func (root *assetTree) funcOrNil() string {
|
| 54 | 54 |
|
| 55 | 55 |
func (root *assetTree) writeGoMap(w io.Writer, nident int) {
|
| 56 | 56 |
fmt.Fprintf(w, "&_bintree_t{%s, map[string]*_bintree_t{\n", root.funcOrNil())
|
| 57 |
- for p, child := range root.Children {
|
|
| 57 |
+ |
|
| 58 |
+ // Sort to make output stable between invocations |
|
| 59 |
+ filenames := make([]string, len(root.Children)) |
|
| 60 |
+ i := 0 |
|
| 61 |
+ for filename, _ := range root.Children {
|
|
| 62 |
+ filenames[i] = filename |
|
| 63 |
+ i++ |
|
| 64 |
+ } |
|
| 65 |
+ sort.Strings(filenames) |
|
| 66 |
+ |
|
| 67 |
+ for _, p := range filenames {
|
|
| 58 | 68 |
ident(w, nident+1) |
| 59 | 69 |
fmt.Fprintf(w, `"%s": `, p) |
| 60 |
- child.writeGoMap(w, nident+1) |
|
| 70 |
+ root.Children[p].writeGoMap(w, nident+1) |
|
| 61 | 71 |
} |
| 62 | 72 |
ident(w, nident) |
| 63 | 73 |
io.WriteString(w, "}}") |