github.com/jurelou/go-magic@v0.0.0-20230518182705-f2995a311800/errors.go (about)

     1  package magic
     2  
     3  import (
     4  	"fmt"
     5  )
     6  
     7  // Error represents an error originating from the underlying Magic library.
     8  type Error struct {
     9  	Errno   int    // The value of errno, if any.
    10  	Message string // The actual error message.
    11  }
    12  
    13  // Error returns a descriptive error message.
    14  func (e *Error) Error() string {
    15  	return fmt.Sprintf("magic: %s", e.Message)
    16  }