summaryrefslogtreecommitdiff
path: root/internal/util
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2024-11-24 18:19:04 -0500
committerGitHub <noreply@github.com>2024-11-24 18:19:04 -0500
commit26e4f7f11a8c10c48af66ce4f2d4c50d5a2dc760 (patch)
treefd72a6c25b97333487aafcd8c86374d709050840 /internal/util
parent0a8ed6b216ab58bf0ae0695a89f602e477c9573c (diff)
feat: Notice messages when performing actions (#11)
* Update releaser CI/CD version * feat: Notice messages when performing actions * Showcase notices in demo.gif
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)
}