mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-05-30 22:13:54 +00:00
update clipboard example
This commit is contained in:
parent
71c641564d
commit
6ba20dfd3d
20
clipboard/example/example.go
Normal file
20
clipboard/example/example.go
Normal 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: 日本語
|
||||
}
|
||||
}
|
||||
}
|
@ -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:
|
||||
// // 日本語
|
||||
// }
|
||||
// }
|
||||
// }
|
Loading…
Reference in New Issue
Block a user