You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
452 B
Go
29 lines
452 B
Go
package clipboard
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestGet(t *testing.T) {
|
|
lsn, err := Listen()
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
for {
|
|
select {
|
|
case cb := <-lsn:
|
|
fmt.Println(cb.plateform)
|
|
fmt.Println(cb.AvailableTypes())
|
|
fmt.Println(cb.Text())
|
|
fmt.Println(cb.HTML())
|
|
case <-time.After(60 * time.Second):
|
|
fmt.Println("not get clipboard data in 60s")
|
|
StopListen()
|
|
time.Sleep(time.Second * 15)
|
|
return
|
|
}
|
|
}
|
|
}
|