func (e *E) As(target interface{}) bool {
	_, ok := target.(**E)
	if ok {
		val := reflect.ValueOf(target)
		val.Elem().Set(reflect.ValueOf(e))
		return ok
	}
	return false
}
As set the target to e only if only target is **E.
package errors
import (
	"net/http"
	"reflect"
)
type E struct {
	Code    int    `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
	Name    string `json:"name,omitempty"`
	err     error
}
func Internal(err error) *E {
	return &E{
		Code:    http.StatusInternalServerError,
		Message: "internal server error",
		Name:    "ERR_INTERNAL",
		err:     err,
	}
}
func InvalidInput(field string) *E {
	return &E{
		Code:    http.StatusBadRequest,
		Message: "invalid input: " + field,
		Name:    "ERR_INVALID_INPUT",
	}
}
func (e *E) Error() string {
	return e.Message
}