diff options
Diffstat (limited to 'result.go')
| -rw-r--r-- | result.go | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -3,6 +3,11 @@ package deadlinks +import ( + "slices" + "strings" +) + // Broken store the link with its HTTP status. type Broken struct { Link string @@ -20,3 +25,11 @@ func newResult() *Result { PageLinks: map[string][]Broken{}, } } + +func (result *Result) sort() { + for _, listBroken := range result.PageLinks { + slices.SortFunc(listBroken, func(a, b Broken) int { + return strings.Compare(a.Link, b.Link) + }) + } +} |
