summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordemo <demo@antix1>2026-05-28 13:31:49 -0400
committerdemo <demo@antix1>2026-05-28 13:32:59 -0400
commit138d431695c22927f1b5ab76486390960f5cbb3c (patch)
tree9ebcfd7a1914f00e8c895d2500e9db250a3f627b
parenteae74f26ada313c15057013a1df6b81b50d94a90 (diff)
feat: add "total entries" as part of XML comment
This is useful mostly in the context of maxURLs=∞, but perhaps it could also help catch some error cases.
-rw-r--r--xml.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/xml.go b/xml.go
index 74ecc0d..e4ad0e8 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: %s, max urls: %s", toSymbol(maxDepth), toSymbol(maxURLs)),
+ Comment: fmt.Sprintf("max depth: %s, max urls: %s, total entries: %d", toSymbol(maxDepth), toSymbol(maxURLs), len(seen)),
}
output, err := xml.MarshalIndent(&set, "", "\t")