summaryrefslogtreecommitdiff
path: root/sort.go
diff options
context:
space:
mode:
authorhorus_arch2015-06-15 13:38:47 +0200
committerhorus_arch2015-06-15 13:38:47 +0200
commitc79e605b60040c4c0e5c792fa447487c2b8ae246 (patch)
treed20c97b59c6252e555618a128ea63f6fa9d016d9 /sort.go
parent3a09b2509102d58fe4e52a9a8fa699f6b42dc327 (diff)
downloaduhttpd-c79e605b60040c4c0e5c792fa447487c2b8ae246.tar.gz
Use flex to extract html. Icono-font used for icons.
Diffstat (limited to 'sort.go')
-rw-r--r--sort.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/sort.go b/sort.go
new file mode 100644
index 0000000..6f34797
--- /dev/null
+++ b/sort.go
@@ -0,0 +1,17 @@
+package main
+
+// Dirty hack. Source:
+// https://stackoverflow.com/questions/26526736/invalid-receiver-type-t-t-is-an-unnamed-type-workaround
+type LinksAsSlice []Link
+
+func (slice LinksAsSlice) Len() int {
+ return len(slice)
+}
+
+func (slice LinksAsSlice) Less(i, j int) bool {
+ return slice[i].Text < slice[j].Text
+}
+
+func (slice LinksAsSlice) Swap(i, j int) {
+ slice[i], slice[j] = slice[j], slice[i]
+}