Initial commit
A
This commit is contained in:
24
main.go
Normal file
24
main.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"golang.design/x/clipboard"
|
||||
)
|
||||
|
||||
func main() {
|
||||
var lines []string
|
||||
|
||||
err := clipboard.Init()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
ch := clipboard.Watch(context.TODO(), clipboard.FmtText)
|
||||
for data := range ch {
|
||||
lines = append(lines, string(data))
|
||||
// fmt.Println(strings.Join(lines, "\n"))
|
||||
fmt.Println(string(data))
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user