mirror of
https://github.com/boolean-maybe/tiki
synced 2026-04-21 13:37:20 +00:00
17 lines
424 B
Go
17 lines
424 B
Go
package service
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/atotto/clipboard"
|
|
)
|
|
|
|
// ExecuteClipboardPipe writes the given rows to the system clipboard.
|
|
// Fields within a row are tab-separated; rows are newline-separated.
|
|
func ExecuteClipboardPipe(rows [][]string) error {
|
|
lines := make([]string, len(rows))
|
|
for i, row := range rows {
|
|
lines[i] = strings.Join(row, "\t")
|
|
}
|
|
return clipboard.WriteAll(strings.Join(lines, "\n"))
|
|
}
|