feat: Add SetClipboard function to utils for setting text to clipboard
This commit is contained in:
@@ -4,6 +4,8 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/atotto/clipboard"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetComputerName() string {
|
func GetComputerName() string {
|
||||||
@@ -56,3 +58,11 @@ func ConvertIPAddress(addrs []net.Addr) []string {
|
|||||||
}
|
}
|
||||||
return ipaddress
|
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)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user