var roleNotFoundRegExp … var userNotFoundRegExp … func init() { … } // IsKeyNotFound returns true if the error code is ErrorCodeKeyNotFound. func IsKeyNotFound(err error) bool { … } // IsRoleNotFound returns true if the error means role not found of v2 API. func IsRoleNotFound(err error) bool { … } // IsUserNotFound returns true if the error means user not found of v2 API. func IsUserNotFound(err error) bool { … }