github.com/RevenueMonster/sqlike@v1.0.6/sql/codec/error.go (about)

     1  package codec
     2  
     3  import (
     4  	"reflect"
     5  )
     6  
     7  // ErrNoEncoder :
     8  type ErrNoEncoder struct {
     9  	Type reflect.Type
    10  }
    11  
    12  func (err ErrNoEncoder) Error() (msg string) {
    13  	if err.Type == nil {
    14  		msg = "no encoder for <nil>"
    15  		return
    16  	}
    17  	msg = "no encoder for " + err.Type.String()
    18  	return
    19  }
    20  
    21  // ErrNoDecoder :
    22  type ErrNoDecoder struct {
    23  	Type reflect.Type
    24  }
    25  
    26  func (err ErrNoDecoder) Error() (msg string) {
    27  	if err.Type == nil {
    28  		msg = "no decoder for <nil>"
    29  		return
    30  	}
    31  	msg = "no decoder for " + err.Type.String()
    32  	return
    33  }