You can fcucking PASTE now!!!

This commit is contained in:
2023-03-27 20:44:39 -04:00
parent 02a27447b9
commit 01a0fc1bd3
8 changed files with 210 additions and 34 deletions

View File

@@ -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)) },
}
}