Documentation
¶
Overview ¶
Package clipboard provides cgo-free access to the system text clipboard.
The API is intentionally tiny: read and write UTF-8 text. Each platform binds the clipboard the OS already provides — NSPasteboard on macOS, the Win32 clipboard on Windows, and X11/Wayland on Linux — with no cgo and no bundled native libraries.
old, _ := clipboard.ReadText()
clipboard.WriteText("hello")
Text is exchanged as UTF-8 Go strings; the backend handles any conversion the platform needs (UTF-16 on Windows, NSString on macOS).
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnsupported = errors.New("clipboard: not supported on this platform")
ErrUnsupported is returned by operations on a platform that has no clipboard backend wired up yet.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.