mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-01 14:43:55 +00:00
fix clipboard golint
This commit is contained in:
parent
43ae76caff
commit
83dcf38788
@ -17,6 +17,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
// Primary choose primary mode on unix
|
||||||
Primary bool
|
Primary bool
|
||||||
|
|
||||||
pasteCmdArgs []string
|
pasteCmdArgs []string
|
||||||
@ -28,7 +29,7 @@ var (
|
|||||||
xclipPasteArgs = []string{xclip, "-out", "-selection", "clipboard"}
|
xclipPasteArgs = []string{xclip, "-out", "-selection", "clipboard"}
|
||||||
xclipCopyArgs = []string{xclip, "-in", "-selection", "clipboard"}
|
xclipCopyArgs = []string{xclip, "-in", "-selection", "clipboard"}
|
||||||
|
|
||||||
missingCommands = errors.New("No clipboard utilities available. Please install xsel or xclip")
|
errMissingCommands = errors.New("No clipboard utilities available. Please install xsel or xclip")
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -65,7 +66,7 @@ func getCopyCommand() *exec.Cmd {
|
|||||||
|
|
||||||
func readAll() (string, error) {
|
func readAll() (string, error) {
|
||||||
if Unsupported {
|
if Unsupported {
|
||||||
return "", missingCommands
|
return "", errMissingCommands
|
||||||
}
|
}
|
||||||
pasteCmd := getPasteCommand()
|
pasteCmd := getPasteCommand()
|
||||||
out, err := pasteCmd.Output()
|
out, err := pasteCmd.Output()
|
||||||
@ -77,7 +78,7 @@ func readAll() (string, error) {
|
|||||||
|
|
||||||
func writeAll(text string) error {
|
func writeAll(text string) error {
|
||||||
if Unsupported {
|
if Unsupported {
|
||||||
return missingCommands
|
return errMissingCommands
|
||||||
}
|
}
|
||||||
copyCmd := getCopyCommand()
|
copyCmd := getCopyCommand()
|
||||||
in, err := copyCmd.StdinPipe()
|
in, err := copyCmd.StdinPipe()
|
||||||
|
@ -63,7 +63,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
version string = "v0.48.0.501, Ben Nevis!"
|
version string = "v0.48.0.503, Ben Nevis!"
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
|
Loading…
Reference in New Issue
Block a user