summaryrefslogtreecommitdiff
path: root/xml.go
diff options
context:
space:
mode:
Diffstat (limited to 'xml.go')
-rw-r--r--xml.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/xml.go b/xml.go
index e1a253f..74ecc0d 100644
--- a/xml.go
+++ b/xml.go
@@ -37,7 +37,7 @@ func toSitemap(seen map[url.URL]int, maxDepth, maxURLs int) (string, error) {
set := XMLURLset{
Xmlns: "http://www.sitemaps.org/schemas/sitemap/0.9",
URLs: xmlURLs,
- Comment: fmt.Sprintf("max depth: %d, max urls: %d", maxDepth, maxURLs),
+ Comment: fmt.Sprintf("max depth: %s, max urls: %s", toSymbol(maxDepth), toSymbol(maxURLs)),
}
output, err := xml.MarshalIndent(&set, "", "\t")
@@ -48,3 +48,11 @@ func toSitemap(seen map[url.URL]int, maxDepth, maxURLs int) (string, error) {
withHeader := fmt.Sprintf("%s\n%s", xml.Header, output)
return withHeader, nil
}
+
+func toSymbol(figure int) string {
+ if figure == 0 {
+ return "∞"
+ }
+
+ return fmt.Sprintf("%d", figure)
+}