diff options
author | Thomas Voss <mail@thomasvoss.com> | 2023-11-29 21:46:26 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2023-11-29 21:46:26 +0100 |
commit | a6c83a3f1b14512a4138fb1744bafdf3f59caaa0 (patch) | |
tree | 06d389fd0a7186948d869d1991bd63e5d50fba31 /err.go | |
parent | 21201921e2ff118ffa6119e155f79383a2d3dc64 (diff) |
Add documentation comments
Diffstat (limited to 'err.go')
-rw-r--r-- | err.go | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -2,14 +2,18 @@ package opts import "fmt" -type ErrBadOption rune +// A BadOptionError describes an option that the user attempted to pass +// which the developer did not register. +type BadOptionError rune -func (e ErrBadOption) Error() string { +func (e BadOptionError) Error() string { return fmt.Sprintf("unknown option ā%cā", e) } -type ErrNoArgument rune +// A NoArgumentError describes an option that the user attempted to pass +// without an argument, which required an argument. +type NoArgumentError rune -func (e ErrNoArgument) Error() string { +func (e NoArgumentError) Error() string { return fmt.Sprintf("expected argument for option ā%cā", e) } |