mirror of
https://github.com/tarampampam/error-pages.git
synced 2024-08-30 18:22:40 +00:00
Index page codes now sorted
This commit is contained in:
parent
2a1fb0eddf
commit
891d491cdb
@ -4,6 +4,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
"sort"
|
||||||
"text/template"
|
"text/template"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -108,6 +109,12 @@ func NewCommand(log *zap.Logger, configFile *string) *cobra.Command { //nolint:f
|
|||||||
log.Debug("saved", zap.Duration("duration", time.Since(startedAt)))
|
log.Debug("saved", zap.Duration("duration", time.Since(startedAt)))
|
||||||
|
|
||||||
if generateIndex {
|
if generateIndex {
|
||||||
|
for _, h := range history {
|
||||||
|
sort.Slice(h, func(i, j int) bool {
|
||||||
|
return h[i].Code < h[j].Code
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
log.Info("index file generation")
|
log.Info("index file generation")
|
||||||
startedAt = time.Now()
|
startedAt = time.Now()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user