text

package
v0.141.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package text provides a CGO-free, cross-platform clipboard text writer that shells out to the platform's native clipboard utility (pbcopy, wl-copy, xclip, xsel, or clip). It is intentionally separate from the image-focused internal/clipboard package, which relies on CGO and is only built on macOS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Writer

type Writer struct{}

Writer copies text to the system clipboard via native CLI utilities.

func NewWriter

func NewWriter() *Writer

NewWriter creates a new clipboard text Writer.

func (*Writer) Copy

func (w *Writer) Copy(ctx context.Context, text string) error

Copy writes text to the system clipboard, trying the platform's clipboard utilities in order and skipping any that are not installed. It returns an actionable error if no working utility is found.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL