clipboard

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 11, 2020 License: MIT Imports: 6 Imported by: 2

README

clipboard

Actions Status Doc Go Report Card

This is a multi-platform clipboard library in Go.

Abstract

  • This is clipboard library in Go, which runs on multiple platforms.
  • External clipboard package is not required.

Supported Platforms

  • Windows
  • macOS
  • Linux, Unix (X11)

Installation

go get github.com/d-tsuji/clipboard

API

package clipboard

// Get returns the current text data of the clipboard.
func Get() (string, error)

// Set sets the current text data of the clipboard.
func Set(text string) error

Documentation

Overview

Example

The purpose of this example is to demonstrate the implementation of get and set.

package main

import (
	"fmt"
	"log"

	"github.com/d-tsuji/clipboard"
)

func main() {
	if err := clipboard.Set("gopher"); err != nil {
		log.Fatal(err)
	}

	text, err := clipboard.Get()
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(text)

}
Output:

gopher

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get() (string, error)

Get returns the current text data of the clipboard.

func Set

func Set(text string) error

Set sets the current text data of the clipboard.

Types

This section is empty.

Jump to

Keyboard shortcuts

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