File tree Expand file tree Collapse file tree 2 files changed +3
-17
lines changed
Expand file tree Collapse file tree 2 files changed +3
-17
lines changed Original file line number Diff line number Diff line change @@ -254,7 +254,7 @@ In other situations you might _not_ want to have a default value set, because a
254254particular CLI flag is mandatory (using cobra's
255255[ MarkFlagRequired] ( https://pkg.go.dev/github.com/spf13/cobra#MarkFlagRequired ) ).
256256Here, cobra's help should not show a (useless) default enum flag setting but
257- only the availabe enum values.
257+ only the available enum values.
258258
259259** Don't assign the zero value** of your enum type to any value, except the
260260"non-existing" default.
@@ -368,20 +368,6 @@ The included `enumflag.code-workspace` defines the following tasks:
368368- ** Run all tests with coverage** task: does what it says on the tin and runs
369369 all tests with coverage.
370370
371- #### Aux Tasks
372-
373- - _ pksite service_ : auxilliary task to run ` pkgsite ` as a background service
374- using ` scripts/pkgsite.sh ` . The script leverages browser-sync and nodemon to
375- hot reload the Go module documentation on changes; many thanks to @mdaverde 's
376- [ _ Build your Golang package docs
377- locally_ ] ( https://mdaverde.com/posts/golang-local-docs ) for paving the way.
378- ` scripts/pkgsite.sh ` adds automatic installation of ` pkgsite ` , as well as the
379- ` browser-sync ` and ` nodemon ` npm packages for the local user.
380- - _ view pkgsite_ : auxilliary task to open the VSCode-integrated "simple" browser
381- and pass it the local URL to open in order to show the module documentation
382- rendered by ` pkgsite ` . This requires a detour via a task input with ID
383- "_ pkgsite_ ".
384-
385371## Make Targets
386372
387373- ` make ` : lists available targets.
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ import (
2626// EnumIdentifiers maps enumeration values to their corresponding textual
2727// representations (~identifiers). This mapping is a one-to-many mapping in that
2828// the same enumeration value may have more than only one associated textual
29- // representation (indentifier ). If more than one textual representation exists
29+ // representation (identifier ). If more than one textual representation exists
3030// for the same enumeration value, then the first textual representation is
3131// considered to be the canonical one.
3232type EnumIdentifiers [E constraints.Integer ] map [E ][]string
@@ -62,7 +62,7 @@ func (m enumMapper[E]) ValueOf(name string) (E, error) {
6262 comparefn = func (s string ) bool { return strings .ToLower (s ) == name }
6363 }
6464 // Try to find a matching enum value textual representation, and then take
65- // its enumation value ("code").
65+ // its enumeration value ("code").
6666 for enumval , ids := range m .m {
6767 if slices .IndexFunc (ids , comparefn ) >= 0 {
6868 return enumval , nil
You can’t perform that action at this time.
0 commit comments