github.com/tickstep/library-go@v0.1.1/prealloc/errors.go (about)

     1  package prealloc
     2  
     3  import (
     4  	"fmt"
     5  )
     6  
     7  type (
     8  	PreAllocError struct {
     9  		ProcName string
    10  		Err      error
    11  	}
    12  )
    13  
    14  func (pe *PreAllocError) Error() string {
    15  	if pe.Err == nil {
    16  		return "<nil>"
    17  	}
    18  	return fmt.Sprintf("%s error: %s\n", pe.ProcName, pe.Err)
    19  }