草庐IT

UniversalError

全部标签

go - 如何在 Go 中创建多级错误子类型

我试图在GO中创建错误的子类型。I'veaskedaquestionpreviously关于此事。现在我面临着多种类型的问题。以下代码显示错误类型定义:/*Interfaces*/typeUniversalErrorinterface{CommonError1}typeCommonError1interface{errorCommonError1()}/*Structs*/typeError1struct{reasonstring}typeError2struct{reasonstring}typeError3struct{reasonstring}/*Interfacefunctio