MCPcopy
hub / github.com/go-sql-driver/mysql / callValuerValue

Function callValuerValue

statement.go:227–234  ·  view source on GitHub ↗

callValuerValue returns vr.Value(), with one exception: If vr.Value is an auto-generated method on a pointer type and the pointer is nil, it would panic at runtime in the panicwrap method. Treat it like nil instead. This is so people can implement driver.Value on value types and still use nil point

(vr driver.Valuer)

Source from the content-addressed store, hash-verified

225// This is an exact copy of the same-named unexported function from the
226// database/sql package.
227func callValuerValue(vr driver.Valuer) (v driver.Value, err error) {
228 if rv := reflect.ValueOf(vr); rv.Kind() == reflect.Ptr &&
229 rv.IsNil() &&
230 rv.Type().Elem().Implements(valuerReflectType) {
231 return nil, nil
232 }
233 return vr.Value()
234}

Callers 1

ConvertValueMethod · 0.85

Calls 1

ValueMethod · 0.45

Tested by

no test coverage detected