summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2024-11-24 16:35:10 -0500
committerGitHub <noreply@github.com>2024-11-24 16:35:10 -0500
commitd02e09c53e216b006ec73f1d01002a8bf214e44c (patch)
treeb3f39a80236d1a9884055dbba934dfe8655c2778 /internal
parent2b5e7c4102b2d54cd2e5fe7471ec11613edf6a21 (diff)
Goreleaser implementation works locally (#9)
Diffstat (limited to 'internal')
-rw-r--r--internal/util/clipboard.go10
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))
}