mirror of
https://github.com/go-vgo/robotgo
synced 2026-05-23 09:48:59 +00:00
update clipboard example
This commit is contained in:
parent
71c641564d
commit
6ba20dfd3d
2 changed files with 20 additions and 22 deletions
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 a new issue