fix clipboard golint

This commit is contained in:
vcaesar 2018-02-01 22:03:57 +08:00
parent 43ae76caff
commit 83dcf38788
2 changed files with 5 additions and 4 deletions

View File

@ -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()

View File

@ -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 (