💡 Improve go doc comments with internal links

This commit is contained in:
Dan Jones 2025-03-31 12:10:05 -05:00
commit c5a9f09166
8 changed files with 38 additions and 34 deletions

View file

@ -9,7 +9,7 @@ import (
"github.com/gosimple/slug"
)
// ErrMissingOriginal is the error returned by Slug if there is no filename.
// ErrMissingOriginal is the error returned by [Slug] if there is no filename.
var ErrMissingOriginal = errors.New("missing original filename")
func getOriginal(c *Config) (string, error) {
@ -37,21 +37,21 @@ func Slug(lang ...string) Generator {
}
}
// HashingFunc is a function that generates a hash.Hash.
// HashingFunc is a function that generates a [hash.Hash].
type HashingFunc func() hash.Hash
// New allows HashingFunc to be used as a Hasher.
// New allows [HashingFunc] to be used as a [Hasher].
func (hf HashingFunc) New() hash.Hash {
return hf()
}
// Hasher is a type returns a hash.Hash.
// All crypto.Hash may be used.
// Hasher is a type returns a [hash.Hash].
// All [crypto.Hash] may be used.
type Hasher interface {
New() hash.Hash
}
// ErrInvalidHash is returned by the Hash generator when an invalid HashType is passed.
// ErrInvalidHash is returned by the [Hash] [Generator] when an invalid [Hasher] is passed.
var ErrInvalidHash = errors.New("invalid hash type")
// Hash generates a name from a hash of the filename.