From d02e09c53e216b006ec73f1d01002a8bf214e44c Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Sun, 24 Nov 2024 16:35:10 -0500 Subject: Goreleaser implementation works locally (#9) --- internal/util/clipboard.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'internal/util/clipboard.go') 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)) } -- cgit v1.2.3