aboutsummaryrefslogtreecommitdiff
path: root/err.go
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-11-29 21:46:26 +0100
committerThomas Voss <mail@thomasvoss.com> 2023-11-29 21:46:26 +0100
commita6c83a3f1b14512a4138fb1744bafdf3f59caaa0 (patch)
tree06d389fd0a7186948d869d1991bd63e5d50fba31 /err.go
parent21201921e2ff118ffa6119e155f79383a2d3dc64 (diff)
Add documentation comments
Diffstat (limited to 'err.go')
-rw-r--r--err.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/err.go b/err.go
index b964c11..cbe96b4 100644
--- a/err.go
+++ b/err.go
@@ -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)
}