Errors
Any non-trivial program will have the need for error reporting sooner or later.Because of this Go has a builtin type specially for errors, called error
. vare error
creates a variable e
of type error
with the value nil
. This errortype is an interface – we’ll look more at interfaces in . Fornow you can just assume that error
is a type just like all other types.
当前内容版权归 Miek Gieben 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 Miek Gieben .