Change Text, Bytes to FromText, FromBytes
This commit is contained in:
parent
f6556aa57f
commit
87494c014a
10
data/data.go
10
data/data.go
@ -74,9 +74,9 @@ func (mime Mime) String () string {
|
||||
return out
|
||||
}
|
||||
|
||||
// Text returns plain text Data given a string.
|
||||
func Text (text string) Data {
|
||||
return Bytes(MimePlain(), []byte(text))
|
||||
// FromText returns plain text Data given a string.
|
||||
func FromText (text string) Data {
|
||||
return FromBytes(MimePlain(), []byte(text))
|
||||
}
|
||||
|
||||
type byteReadCloser struct { *bytes.Reader }
|
||||
@ -87,8 +87,8 @@ type bytesData struct {
|
||||
buffer []byte
|
||||
}
|
||||
|
||||
// Bytes constructs a Data given a buffer and a mime type.
|
||||
func Bytes (mime Mime, buffer []byte) Data {
|
||||
// FromBytes constructs a Data given a buffer and a mime type.
|
||||
func FromBytes (mime Mime, buffer []byte) Data {
|
||||
return bytesData {
|
||||
mime: mime,
|
||||
buffer: buffer,
|
||||
|
Loading…
Reference in New Issue
Block a user