summaryrefslogtreecommitdiff
path: root/internal/util/clipboard.go
blob: 64930fa143138120bfa43001fd70e670ff572619 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package util

import (
	"log/slog"

	"github.com/atotto/clipboard"
)

// Copies any object that has the Stringer interface to the clipboard
func Copy(str string) {
	if err := clipboard.WriteAll(str); err != nil {
		slog.Error("Unable to copy item", "item", str, ErrKey, err)
	}
}