summaryrefslogtreecommitdiffhomepage
path: root/pkg/syserr
diff options
context:
space:
mode:
authorIan Gudger <igudger@google.com>2018-05-22 11:53:42 -0700
committerShentubot <shentubot@google.com>2018-05-22 11:54:31 -0700
commit3a6070dc9882d43b00bd66b23492daa422435c7c (patch)
tree1b35ed2f306c56eaeb17aa1c968dd0a9c3e2c149 /pkg/syserr
parented2b86a54942dfd245e9f872e6da52d9bde0da6d (diff)
Clarify that syserr.New must only be called during init
PiperOrigin-RevId: 197599402 Change-Id: I23eb0336195ab0d3e5fb49c0c57fc9e0715a9b75
Diffstat (limited to 'pkg/syserr')
-rw-r--r--pkg/syserr/syserr.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/pkg/syserr/syserr.go b/pkg/syserr/syserr.go
index eaa0ec920..5d9fa24de 100644
--- a/pkg/syserr/syserr.go
+++ b/pkg/syserr/syserr.go
@@ -31,6 +31,8 @@ type Error struct {
}
// New creates a new Error and adds a translation for it.
+//
+// New must only be called at init.
func New(message string, linuxTranslation *linux.Errno) *Error {
err := &Error{message}
linuxABITranslations[err] = linuxTranslation