func (b Blob) Binary() []byte {
	if len(b.binary) != 0 || len(b.text) == 0 {
		return b.binary
	}

	// Trim any whitespace characters from the text representation of
	// the Blob.
	trimmedText := bytes.Map(func(r rune) rune {
		if r == ' ' || r == '\r' || r == '\n' || r == '\t' || r == '\f' || r == '\v' {
			return -1
		}
		return r
	}, b.text)

	b.binary = make([]byte, base64.StdEncoding.DecodedLen(len(trimmedText)))
	if _, err := base64.StdEncoding.Decode(b.binary, trimmedText); err != nil {
		panic(err)
	}
	return b.binary
}
// Binary returns the raw binary representation of the Blob.  If the
// representation was originally text and there is a problem decoding it,
// then this will panic.  This is because it is assumed that the original
// parsing of the text value will catch improperly formatted encodings.
Binary returns the raw binary representation of the Blob.  If the
representation was originally text and there is a problem decoding it,
then this will panic.  This is because it is assumed that the original
parsing of the text value will catch improperly formatted encodings.
// Binary returns the raw binary representation of the Blob . If the // representation was originally text and there is a problem decoding it // then this will panic . This is because it is assumed that the original // parsing of the text value will catch improperly formatted encodings .
func (b Blob) Binary() []byte {
	if len(b.binary) != 0 || len(b.text) == 0 {
		return b.binary
	}
	trimmedText := bytes.Map(func(r rune) rune {
		if r == ' ' || r == '\r' || r == '\n' || r == '\t' || r == '\f' || r == '\v' {
			return -1
		}
		return r
	}, b.text)
	b.binary = make([]byte, base64.StdEncoding.DecodedLen(len(trimmedText)))
	if _, err := base64.StdEncoding.Decode(b.binary, trimmedText); err != nil {
		panic(err)
	}
	return b.binary
}
func ( b Blob ) Binary ( ) [ ] byte { if len ( b . binary ) != 0 || len ( b . text ) == 0 { return b . binary } trimmedText := bytes . Map ( func ( r rune ) rune { if r == ' ' || r == '\r' || r == '\n' || r == '\t' || r == '\f' || r == '\v' { return - 1 } return r } , b . text ) b . binary = make ( [ ] byte , base64 . StdEncoding . DecodedLen ( len ( trimmedText ) ) ) if _ , err := base64 . StdEncoding . Decode ( b . binary , trimmedText ) ; err != nil { panic ( err ) } return b . binary }
Binary returns the raw binary representation of the Blob.
Binary returns the raw binary representation of the Blob .
// Trim any whitespace characters from the text representation of // the Blob.