// Scan implements the database/sql Scanner interface. It expects to receive a
// valid WKB encoded []byte describing a Polygon, or NULL as a nil from
// an SQL database. A zero-length or nil []byte will be considered NULL, and p
// will be nulled. Otherwise, the value will be passed to types.SFPolygon to be
// scanned and parsed as a WKB Polygon.
Scan implements the database/sql Scanner interface. It expects to receive a
valid WKB encoded []byte describing a Polygon, or NULL as a nil from
an SQL database. A zero-length or nil []byte will be considered NULL, and p
will be nulled. Otherwise, the value will be passed to types.SFPolygon to be
scanned and parsed as a WKB Polygon.
// Scan implements the database / sql Scanner interface . It expects to receive a // valid WKB encoded [] byte describing a Polygon or NULL as a nil from // an SQL database . A zero - length or nil [] byte will be considered NULL and p // will be nulled . Otherwise the value will be passed to types . SFPolygon to be // scanned and parsed as a WKB Polygon .
func (p *SFPolygon) Scan(src interface{}) error {
	if p == nil {
		return fmt.Errorf("null.SFPolygon: Scan called on nil pointer")
	}
	switch x := src.(type) {
	case nil:
		p.Valid = false
		return nil
	case []byte:
		if len(x) == 0 {
			p.Polygon = types.SFPolygon{}
			p.Valid = false
			return nil
		}
		err := p.Polygon.Scan(x)
		if err != nil {
			return err
		}
		p.Valid = true
		return nil
	default:
		return fmt.Errorf("null.SFPolygon: cannot scan type %T (%v)", src, src)
	}
}
func ( p * SFPolygon ) Scan ( src interface { } ) error { if p == nil { return fmt . Errorf ( " " ) } switch x := src . ( type ) { case nil : p . Valid = false return nil case [ ] byte : if len ( x ) == 0 { p . Polygon = types . SFPolygon { } p . Valid = false return nil } err := p . Polygon . Scan ( x ) if err != nil { return err } p . Valid = true return nil default : return fmt . Errorf ( " " , src , src ) } }
Scan implements the database/sql Scanner interface.
Scan implements the database / sql Scanner interface .