diff --git a/ui/clipboard.go b/ui/clipboard.go new file mode 100644 index 0000000..2d923aa --- /dev/null +++ b/ui/clipboard.go @@ -0,0 +1,23 @@ +package ui + +type Clipboard interface { + WriteText(t string) error + ReadText() (string, error) +} + +var DefaultClipboard Clipboard = &clipboard{} + +func SetClipboard(c Clipboard) { DefaultClipboard = c } + +type clipboard struct { + value string +} + +func (c *clipboard) WriteText(t string) error { + c.value = t + return nil +} + +func (c *clipboard) ReadText() (string, error) { + return c.value, nil +}