summaryrefslogtreecommitdiff
path: root/internal/util
diff options
context:
space:
mode:
Diffstat (limited to 'internal/util')
-rw-r--r--internal/util/clipboard.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/util/clipboard.go b/internal/util/clipboard.go
index 64930fa..1425d97 100644
--- a/internal/util/clipboard.go
+++ b/internal/util/clipboard.go
@@ -1,14 +1,17 @@
package util
import (
+ "fmt"
"log/slog"
"github.com/atotto/clipboard"
)
// Copies any object that has the Stringer interface to the clipboard
-func Copy(str string) {
+func Copy(str string) string {
if err := clipboard.WriteAll(str); err != nil {
slog.Error("Unable to copy item", "item", str, ErrKey, err)
+ return fmt.Sprintf("Copy operation failed: %v", err)
}
+ return fmt.Sprintf("Copied %s to clipboard!", str)
}