Clarify that syserr.New must only be called during init

PiperOrigin-RevId: 197599402
Change-Id: I23eb0336195ab0d3e5fb49c0c57fc9e0715a9b75
This commit is contained in:
Ian Gudger 2018-05-22 11:53:42 -07:00 committed by Shentubot
parent ed2b86a549
commit 3a6070dc98
1 changed files with 2 additions and 0 deletions

View File

@ -31,6 +31,8 @@ type Error struct {
} }
// New creates a new Error and adds a translation for it. // 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 { func New(message string, linuxTranslation *linux.Errno) *Error {
err := &Error{message} err := &Error{message}
linuxABITranslations[err] = linuxTranslation linuxABITranslations[err] = linuxTranslation