diff --git a/common/herrors/errors.go b/common/herrors/errors.go index 822271ef2..4d8642362 100644 --- a/common/herrors/errors.go +++ b/common/herrors/errors.go @@ -49,7 +49,7 @@ func Recover(args ...any) { } } -// Get the current goroutine id. Used only for debugging. +// GetGID the current goroutine id. Used only for debugging. func GetGID() uint64 { b := make([]byte, 64) b = b[:runtime.Stack(b, false)] diff --git a/common/herrors/file_error.go b/common/herrors/file_error.go index 9273b2a80..30417897f 100644 --- a/common/herrors/file_error.go +++ b/common/herrors/file_error.go @@ -35,7 +35,7 @@ import ( type FileError interface { error - // ErroContext holds some context information about the error. + // ErrorContext holds some context information about the error. ErrorContext() *ErrorContext text.Positioner diff --git a/common/maps/params.go b/common/maps/params.go index a3e607b89..d94d16f9d 100644 --- a/common/maps/params.go +++ b/common/maps/params.go @@ -37,7 +37,7 @@ func (p Params) GetNested(indices ...string) any { return v } -// Set overwrites values in dst with values in src for common or new keys. +// SetParams overwrites values in dst with values in src for common or new keys. // This is done recursively. func SetParams(dst, src Params) { for k, v := range src { @@ -83,7 +83,7 @@ func MergeParamsWithStrategy(strategy string, dst, src Params) { dst.merge(ParamsMergeStrategy(strategy), src) } -// MergeParamsWithStrategy transfers values from src to dst for new keys using the merge encoded in dst. +// MergeParams transfers values from src to dst for new keys using the merge encoded in dst. // This is done recursively. func MergeParams(dst, src Params) { ms, _ := dst.GetMergeStrategy() diff --git a/config/security/whitelist.go b/config/security/whitelist.go index ee1025d3b..72a80da2e 100644 --- a/config/security/whitelist.go +++ b/config/security/whitelist.go @@ -84,7 +84,7 @@ func NewWhitelist(patterns ...string) Whitelist { return Whitelist{patterns: patternsr, patternsStrings: patternsStrings} } -// Accepted reports whether name is whitelisted. +// Accept reports whether name is whitelisted. func (w Whitelist) Accept(name string) bool { if w.acceptNone { return false diff --git a/deps/deps.go b/deps/deps.go index 9cb8557a5..0eeb4248b 100644 --- a/deps/deps.go +++ b/deps/deps.go @@ -231,7 +231,7 @@ type globalErrHandler struct { quit chan struct{} } -// SendErr sends the error on a channel to be handled later. +// SendError sends the error on a channel to be handled later. // This can be used in situations where returning and aborting the current // operation isn't practical. func (e *globalErrHandler) SendError(err error) { diff --git a/helpers/general.go b/helpers/general.go index e8d8bdecc..50f7920f6 100644 --- a/helpers/general.go +++ b/helpers/general.go @@ -117,7 +117,7 @@ func UniqueStringsReuse(s []string) []string { return result } -// UniqueStringsReuse returns a sorted slice with any duplicates removed. +// UniqueStringsSorted returns a sorted slice with any duplicates removed. // It will modify the input slice. func UniqueStringsSorted(s []string) []string { if len(s) == 0 { diff --git a/hugofs/fs.go b/hugofs/fs.go index 855a821df..5dae3a78a 100644 --- a/hugofs/fs.go +++ b/hugofs/fs.go @@ -85,7 +85,7 @@ func NewFromOld(fs afero.Fs, cfg config.Provider) *Fs { return newFs(fs, fs, workingDir, publishDir) } -// NewFrom creates a new Fs based on the provided Afero Fss +// NewFromSourceAndDestination creates a new Fs based on the provided Afero Fss // as the source and destination file systems. func NewFromSourceAndDestination(source, destination afero.Fs, cfg config.Provider) *Fs { workingDir, publishDir := getWorkingPublishDir(cfg) @@ -178,7 +178,7 @@ func MakeReadableAndRemoveAllModulePkgDir(fs afero.Fs, dir string) (int, error) return counter, fs.RemoveAll(dir) } -// HasOsFs returns whether fs is an OsFs or if it fs wraps an OsFs. +// IsOsFs returns whether fs is an OsFs or if it fs wraps an OsFs. // TODO(bep) make this nore robust. func IsOsFs(fs afero.Fs) bool { var isOsFs bool @@ -202,7 +202,7 @@ type FilesystemsUnwrapper interface { UnwrapFilesystems() []afero.Fs } -// FilesystemsProvider returns the underlying filesystem. +// FilesystemUnwrapper returns the underlying filesystem. type FilesystemUnwrapper interface { UnwrapFilesystem() afero.Fs } diff --git a/hugolib/page.go b/hugolib/page.go index 7356cb545..2e6b6c36f 100644 --- a/hugolib/page.go +++ b/hugolib/page.go @@ -146,7 +146,7 @@ func (p *pageState) Eq(other any) bool { return p == pp } -// GetIdentify is for internal use. +// GetIdentity is for internal use. func (p *pageState) GetIdentity() identity.Identity { return identity.NewPathIdentity(files.ComponentFolderContent, filepath.FromSlash(p.Pathc())) } diff --git a/hugolib/pagecollections.go b/hugolib/pagecollections.go index 6f7d291bc..b49669bb6 100644 --- a/hugolib/pagecollections.go +++ b/hugolib/pagecollections.go @@ -57,7 +57,7 @@ func (c *PageCollections) AllPages() page.Pages { return c.allPages.get() } -// AllPages returns all regular pages for all languages. +// AllRegularPages returns all regular pages for all languages. func (c *PageCollections) AllRegularPages() page.Pages { return c.allRegularPages.get() } diff --git a/identity/identity.go b/identity/identity.go index 033409b80..e73951caf 100644 --- a/identity/identity.go +++ b/identity/identity.go @@ -20,7 +20,7 @@ import ( "sync/atomic" ) -// NewIdentityManager creates a new Manager starting at id. +// NewManager creates a new Manager starting at id. func NewManager(id Provider) Manager { return &identityManager{ Provider: id, diff --git a/langs/i18n/translationProvider.go b/langs/i18n/translationProvider.go index 6d7b3ecfd..2c3c15710 100644 --- a/langs/i18n/translationProvider.go +++ b/langs/i18n/translationProvider.go @@ -123,7 +123,7 @@ func addTranslationFile(bundle *i18n.Bundle, r source.File) error { return nil } -// Clone sets the language func for the new language. +// CloneResource sets the language func for the new language. func (tp *TranslationProvider) CloneResource(dst, src *deps.Deps) error { dst.Translate = tp.t.Func(dst.Conf.Language().Lang) return nil diff --git a/lazy/init.go b/lazy/init.go index bfb9c4e07..9a25e1e05 100644 --- a/lazy/init.go +++ b/lazy/init.go @@ -73,7 +73,7 @@ func (ini *Init) Branch(initFn func(context.Context) (any, error)) *Init { return ini.add(true, initFn) } -// BranchdWithTimeout is same as Branch, but with a timeout. +// BranchWithTimeout is same as Branch, but with a timeout. func (ini *Init) BranchWithTimeout(timeout time.Duration, f func(ctx context.Context) (any, error)) *Init { return ini.Branch(func(ctx context.Context) (any, error) { return ini.withTimeout(ctx, timeout, f) diff --git a/markup/asciidocext/asciidocext_config/config.go b/markup/asciidocext/asciidocext_config/config.go index 1409b2783..4c38fbbbf 100644 --- a/markup/asciidocext/asciidocext_config/config.go +++ b/markup/asciidocext/asciidocext_config/config.go @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package asciidoc_config holds asciidoc related configuration. +// Package asciidocext_config holds asciidoc related configuration. package asciidocext_config var ( diff --git a/markup/converter/hooks/hooks.go b/markup/converter/hooks/hooks.go index 5c7b9692d..c5be4d1f0 100644 --- a/markup/converter/hooks/hooks.go +++ b/markup/converter/hooks/hooks.go @@ -121,7 +121,7 @@ type HeadingContext interface { // HeadingRenderer describes a uniquely identifiable rendering hook. type HeadingRenderer interface { - // Render writes the rendered content to w using the data in w. + // RenderHeading writes the rendered content to w using the data in w. RenderHeading(cctx context.Context, w io.Writer, ctx HeadingContext) error identity.Provider } diff --git a/markup/goldmark/codeblocks/transform.go b/markup/goldmark/codeblocks/transform.go index be5334b5f..829dfcc19 100644 --- a/markup/goldmark/codeblocks/transform.go +++ b/markup/goldmark/codeblocks/transform.go @@ -6,7 +6,7 @@ import ( "github.com/yuin/goldmark/text" ) -// Kind is the kind of an Hugo code block. +// KindCodeBlock is the kind of an Hugo code block. var KindCodeBlock = ast.NewNodeKind("HugoCodeBlock") // Its raw contents are the plain text of the code block. diff --git a/markup/goldmark/goldmark_config/config.go b/markup/goldmark/goldmark_config/config.go index f35427ac1..a6fe0e624 100644 --- a/markup/goldmark/goldmark_config/config.go +++ b/markup/goldmark/goldmark_config/config.go @@ -20,7 +20,7 @@ const ( AutoHeadingIDTypeBlackfriday = "blackfriday" ) -// DefaultConfig holds the default Goldmark configuration. +// Default holds the default Goldmark configuration. var Default = Config{ Extensions: Extensions{ Typographer: Typographer{ diff --git a/markup/highlight/highlight.go b/markup/highlight/highlight.go index cb0d578de..e2a4ccdb9 100644 --- a/markup/highlight/highlight.go +++ b/markup/highlight/highlight.go @@ -148,7 +148,7 @@ func (h chromaHighlighter) IsDefaultCodeBlockRenderer() bool { var id = identity.NewPathIdentity("chroma", "highlight") -// GetIdentify is for internal use. +// GetIdentity is for internal use. func (h chromaHighlighter) GetIdentity() identity.Identity { return id } diff --git a/markup/internal/attributes/attributes.go b/markup/internal/attributes/attributes.go index 09bba5c41..d2c8a860f 100644 --- a/markup/internal/attributes/attributes.go +++ b/markup/internal/attributes/attributes.go @@ -199,7 +199,7 @@ func RenderASTAttributes(w hugio.FlexiWriter, attributes ...ast.Attribute) { } } -// Render writes the attributes to the given as attributes to an HTML element. +// RenderAttributes Render writes the attributes to the given as attributes to an HTML element. // This is used for the default codeblock rendering. // This performs HTML escaping of string attributes. func RenderAttributes(w hugio.FlexiWriter, skipClass bool, attributes ...Attribute) { diff --git a/markup/tableofcontents/tableofcontents.go b/markup/tableofcontents/tableofcontents.go index 774b5c6cd..5afb36067 100644 --- a/markup/tableofcontents/tableofcontents.go +++ b/markup/tableofcontents/tableofcontents.go @@ -31,7 +31,7 @@ type Builder struct { toc *Fragments } -// Add adds the heading to the ToC. +// AddAt adds the heading to the ToC. func (b *Builder) AddAt(h *Heading, row, level int) { if b.toc == nil { b.toc = &Fragments{} diff --git a/resources/page/page.go b/resources/page/page.go index 1ec56e8cf..b1c867195 100644 --- a/resources/page/page.go +++ b/resources/page/page.go @@ -334,7 +334,7 @@ type PageWithoutContent interface { // Used in change/dependency tracking. identity.Provider - // Headings returns the headings for this page when a filter is set. + // HeadingsFiltered returns the headings for this page when a filter is set. // This is currently only triggered with the Related content feature // and the "fragments" type of index. HeadingsFiltered(context.Context) tableofcontents.Headings @@ -373,7 +373,7 @@ type RefProvider interface { // RelRef returns a relative URL to a page. RelRef(argsm map[string]any) (string, error) - // RefFrom is for internal use only. + // RelRefFrom is for internal use only. RelRefFrom(argsm map[string]any, source any) (string, error) } diff --git a/resources/page/site.go b/resources/page/site.go index aff7e86fe..16e070160 100644 --- a/resources/page/site.go +++ b/resources/page/site.go @@ -128,13 +128,13 @@ type Site interface { // For internal use only. GetPageWithTemplateInfo(info tpl.Info, ref ...string) (Page, error) - // BuildDraft is deprecated and will be removed in a future release. + // BuildDrafts is deprecated and will be removed in a future release. BuildDrafts() bool - // IsMultilingual reports whether this site is configured with more than one language. + // IsMultiLingual reports whether this site is configured with more than one language. IsMultiLingual() bool - // LanguagePrefi returns the language prefix for this site. + // LanguagePrefix returns the language prefix for this site. LanguagePrefix() string } diff --git a/resources/postpub/postpub.go b/resources/postpub/postpub.go index 5911362ec..93b5c2638 100644 --- a/resources/postpub/postpub.go +++ b/resources/postpub/postpub.go @@ -55,7 +55,7 @@ func NewPostPublishResource(id int, r resource.Resource) PostPublishedResource { } } -// postPublishResource holds a Resource to be transformed post publishing. +// PostPublishResource holds a Resource to be transformed post publishing. type PostPublishResource struct { prefix string delegate resource.Resource diff --git a/resources/resource_transformers/tocss/dartsass/client.go b/resources/resource_transformers/tocss/dartsass/client.go index f45e6537a..f358b93e5 100644 --- a/resources/resource_transformers/tocss/dartsass/client.go +++ b/resources/resource_transformers/tocss/dartsass/client.go @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package godartsass integrates with the Dass Sass Embedded protocol to transpile +// Package dartsass integrates with the Dass Sass Embedded protocol to transpile // SCSS/SASS. package dartsass diff --git a/tpl/compare/compare.go b/tpl/compare/compare.go index 2ef5aacfe..907be9b15 100644 --- a/tpl/compare/compare.go +++ b/tpl/compare/compare.go @@ -197,7 +197,7 @@ func (n *Namespace) Le(first any, others ...any) bool { return true } -// Lt returns the boolean truth of arg1 < arg2 && arg1 < arg3 && arg1 < arg4. +// LtCollate returns the boolean truth of arg1 < arg2 && arg1 < arg3 && arg1 < arg4. // The provided collator will be used for string comparisons. // This is for internal use. func (n *Namespace) LtCollate(collator *langs.Collator, first any, others ...any) bool {