update clipboard example

This commit is contained in:
vcaesar 2018-07-13 18:38:29 +08:00
parent 71c641564d
commit 6ba20dfd3d
2 changed files with 20 additions and 22 deletions

View File

@ -0,0 +1,20 @@
package main
import (
"log"
"github.com/go-vgo/robotgo/clipboard"
)
func main() {
clipboard.WriteAll("日本語")
text, err := clipboard.ReadAll()
if err != nil {
log.Println("clipboard read all error: ", err)
} else {
if text != "" {
log.Println("text is: ", text)
// Output: 日本語
}
}
}

View File

@ -1,22 +0,0 @@
package clipboard_test
// import (
// "fmt"
// "github.com/go-vgo/robotgo/clipboard"
// )
// func Example() {
// clipboard.WriteAll("日本語")
// text, err := clipboard.ReadAll()
// if err != nil {
// fmt.Println(err)
// } else {
// if text != "" {
// fmt.Println(text)
// // Output:
// // 日本語
// }
// }
// }