MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / contentEqualIgnoringModDate

Function contentEqualIgnoringModDate

cmd/gen-docs/main.go:207–214  ·  view source on GitHub ↗

contentEqualIgnoringModDate compares two file contents, treating the modDate frontmatter line as identical regardless of actual date value. Normalizes CRLF to LF before comparing so existing files with different line endings don't cause false mismatches.

(a, b []byte)

Source from the content-addressed store, hash-verified

205// Normalizes CRLF to LF before comparing so existing files with different
206// line endings don't cause false mismatches.
207func contentEqualIgnoringModDate(a, b []byte) bool {
208 placeholder := []byte("modDate: PLACEHOLDER")
209 cr := []byte("\r\n")
210 lf := []byte("\n")
211 normA := bytes.ReplaceAll(modDatePattern.ReplaceAll(a, placeholder), cr, lf)
212 normB := bytes.ReplaceAll(modDatePattern.ReplaceAll(b, placeholder), cr, lf)
213 return bytes.Equal(normA, normB)
214}
215
216const documentationTemplate = `---
217layout: src/layouts/Default.astro

Callers 1

GenMarkdownTreeCustomFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected