From 26e4f7f11a8c10c48af66ce4f2d4c50d5a2dc760 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Sun, 24 Nov 2024 18:19:04 -0500 Subject: feat: Notice messages when performing actions (#11) * Update releaser CI/CD version * feat: Notice messages when performing actions * Showcase notices in demo.gif --- internal/util/clipboard.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'internal/util') 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) } -- cgit v1.2.3