diff options
Diffstat (limited to 'internal')
-rw-r--r-- | internal/util/clipboard.go | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/internal/util/clipboard.go b/internal/util/clipboard.go index 4aaf828..64930fa 100644 --- a/internal/util/clipboard.go +++ b/internal/util/clipboard.go @@ -3,16 +3,12 @@ package util import ( "log/slog" - "golang.design/x/clipboard" + "github.com/atotto/clipboard" ) // Copies any object that has the Stringer interface to the clipboard func Copy(str string) { - // Initialize the clipboard - if err := clipboard.Init(); err != nil { - slog.Error("failed to initialize clipboard", "error", err) - return + if err := clipboard.WriteAll(str); err != nil { + slog.Error("Unable to copy item", "item", str, ErrKey, err) } - - clipboard.Write(clipboard.FmtText, []byte(str)) } |