Wrapping more than one static error to use with errors.Is

后端 未结 0 1291
天涯浪人
天涯浪人 2021-01-15 08:46

Go 1.13 introduced the errors.Is function to check if an error contains a target error in its chain:

err := fmt.Errorf("access denied: %w", ErrPermi         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题