gitee.com/lh-her-team/common@v1.5.1/birdsnest/errors.go (about)

     1  package birdsnest
     2  
     3  import (
     4  	"fmt"
     5  )
     6  
     7  type SprintfError string
     8  
     9  // Error error information
    10  func (s SprintfError) Error() string {
    11  	return string(s)
    12  }
    13  
    14  func NewError(s string, args ...interface{}) SprintfError {
    15  	return SprintfError(fmt.Sprintf(s, args...))
    16  }