You can fcucking PASTE now!!!
This commit is contained in:
11
data/data.go
11
data/data.go
@@ -1,6 +1,7 @@
|
||||
package data
|
||||
|
||||
import "io"
|
||||
import "bytes"
|
||||
|
||||
// Data represents arbitrary polymorphic data that can be used for data transfer
|
||||
// between applications.
|
||||
@@ -18,3 +19,13 @@ type Mime struct {
|
||||
var MimePlain = Mime { "text", "plain" }
|
||||
|
||||
var MimeFile = Mime { "text", "uri-list" }
|
||||
|
||||
type byteReadCloser struct { *bytes.Reader }
|
||||
func (byteReadCloser) Close () error { return nil }
|
||||
|
||||
// Text returns plain text Data given a string.
|
||||
func Text (text string) Data {
|
||||
return Data {
|
||||
MimePlain: byteReadCloser { bytes.NewReader([]byte(text)) },
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user