From 0485e21eaa82ffec1b5d490112703c89a930d331 Mon Sep 17 00:00:00 2001 From: Charles Iliya Krempeaux Date: Thu, 4 Jul 2024 07:53:50 -0700 Subject: [PATCH] update to README.md --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6c84b64..81df2ef 100644 --- a/README.md +++ b/README.md @@ -15,12 +15,17 @@ Online documentation, which includes examples, can be found at: http://godoc.org There are two ways to create errors — With `erorr.Error`: + ``` const err error = erorr.Error("internal-error") ``` + +**NOTICE THAT THAT ERROR IS A `const` RATHER THAN A `var`.** + +**Errors creating using `erorr.Error` can be a Go `const`.** + And with `erorr.Errorf`: + ``` var err error = erorr.Errorf("bad value for id %q", id) ``` - -**One thing to notice is that `erorr.Error` errors can be a Go `const`.**