6

Is there a way to get the information that is saved in clipboard (copy & paste) in Go?

Coldblue
  • 144
  • 2
  • 8
  • Possible duplicate of [How to use the clipboard in Go?](https://stackoverflow.com/questions/17178617/how-to-use-the-clipboard-in-go) – Dave C Jun 15 '18 at 14:43
  • Possible duplicate of [How to copy text to / from clipboard in Go?](https://stackoverflow.com/q/21340920/10197418) – FObersteiner Jan 07 '22 at 10:31

2 Answers2

6

Since I'm not sure what OS you're on, I'll just recommend a library supporting the tree major ones.

https://github.com/atotto/clipboard

Filip Haglund
  • 13,919
  • 13
  • 64
  • 113
0

Another multi-platform library that allows you to set/get text to/from the clipboard. https://github.com/F1bonacc1/glippy

The advantage of glippy is that it doesn't require installation of additional packages in Linux ('xclip' or 'xsel').

fibonacci
  • 186
  • 1
  • 7