From f7f892fb59f8e728ce8f67eec0094b839ecf8079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Sat, 15 Aug 2020 07:19:53 +0200 Subject: [PATCH] hswg: deduplicate backlinks --- hswg/main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hswg/main.go b/hswg/main.go index 2a46c6e..dfc6ed3 100644 --- a/hswg/main.go +++ b/hswg/main.go @@ -236,9 +236,12 @@ func main() { sort.Strings(e.backlinks) - backlinks := []string{} + backlinks, last := []string{}, "" for _, name := range e.backlinks { - backlinks = append(backlinks, makeLink(&entries, name)) + if name != last { + backlinks = append(backlinks, makeLink(&entries, name)) + } + last = name } if len(backlinks) > 0 {