Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: fix typos #9

Merged
merged 1 commit into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ In other situations you might _not_ want to have a default value set, because a
particular CLI flag is mandatory (using cobra's
[MarkFlagRequired](https://pkg.go.dev/github.com/spf13/cobra#MarkFlagRequired)).
Here, cobra's help should not show a (useless) default enum flag setting but
only the availabe enum values.
only the available enum values.

**Don't assign the zero value** of your enum type to any value, except the
"non-existing" default.
Expand Down Expand Up @@ -370,14 +370,14 @@ The included `enumflag.code-workspace` defines the following tasks:

#### Aux Tasks

- _pksite service_: auxilliary task to run `pkgsite` as a background service
- _pksite service_: auxiliary task to run `pkgsite` as a background service
using `scripts/pkgsite.sh`. The script leverages browser-sync and nodemon to
hot reload the Go module documentation on changes; many thanks to @mdaverde's
[_Build your Golang package docs
locally_](https://mdaverde.com/posts/golang-local-docs) for paving the way.
`scripts/pkgsite.sh` adds automatic installation of `pkgsite`, as well as the
`browser-sync` and `nodemon` npm packages for the local user.
- _view pkgsite_: auxilliary task to open the VSCode-integrated "simple" browser
- _view pkgsite_: auxiliary task to open the VSCode-integrated "simple" browser
and pass it the local URL to open in order to show the module documentation
rendered by `pkgsite`. This requires a detour via a task input with ID
"_pkgsite_".
Expand Down
4 changes: 2 additions & 2 deletions mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
// EnumIdentifiers maps enumeration values to their corresponding textual
// representations (~identifiers). This mapping is a one-to-many mapping in that
// the same enumeration value may have more than only one associated textual
// representation (indentifier). If more than one textual representation exists
// representation (identifier). If more than one textual representation exists
// for the same enumeration value, then the first textual representation is
// considered to be the canonical one.
type EnumIdentifiers[E constraints.Integer] map[E][]string
Expand Down Expand Up @@ -62,7 +62,7 @@ func (m enumMapper[E]) ValueOf(name string) (E, error) {
comparefn = func(s string) bool { return strings.ToLower(s) == name }
}
// Try to find a matching enum value textual representation, and then take
// its enumation value ("code").
// its enumeration value ("code").
for enumval, ids := range m.m {
if slices.IndexFunc(ids, comparefn) >= 0 {
return enumval, nil
Expand Down
Loading