feat: Add SetClipboard function to utils for setting text to clipboard

This commit is contained in:
2024-06-28 09:03:38 -05:00
parent 82fe5778d4
commit 7d7084494e

View File

@@ -4,6 +4,8 @@ import (
"net"
"os"
"strings"
"github.com/atotto/clipboard"
)
func GetComputerName() string {
@@ -56,3 +58,11 @@ func ConvertIPAddress(addrs []net.Addr) []string {
}
return ipaddress
}
// SetClipboard, returns error or nil
func SetClipboard(text string) error {
// Set the clipboard to the text
// Get the clipboard from the clipboard package
return clipboard.WriteAll(text)
}