clipboard access for golang
pngpaste is required to paste screenshots.
brew install pngpaste
import (
"fmt"
"github.com/davidjairala/clipboard-go"
)
func main() {
resultFile, err := clipboard.GetClipboard()
fmt.Println(resultFile.Filename)
}
The file type will be either txt
or png
depending on what you had in your clipboard.