gitee.com/sy_183/go-common@v1.0.5-0.20231205030221-958cfe129b47/errors/exist.go (about)

     1  package errors
     2  
     3  import "fmt"
     4  
     5  type Exist struct {
     6  	Target string
     7  }
     8  
     9  func NewExist(target string) Exist {
    10  	return Exist{Target: target}
    11  }
    12  
    13  func (e Exist) Error() string {
    14  	return fmt.Sprintf("%s已经存在", e.Target)
    15  }