MCPcopy
hub / github.com/bitfield/script / Slice

Function Slice

script.go:189–194  ·  view source on GitHub ↗

Slice creates a pipe containing each element of s, one per line. If s is empty or nil, then the pipe is empty.

(s []string)

Source from the content-addressed store, hash-verified

187// Slice creates a pipe containing each element of s, one per line. If s is
188// empty or nil, then the pipe is empty.
189func Slice(s []string) *Pipe {
190 if len(s) == 0 {
191 return NewPipe()
192 }
193 return Echo(strings.Join(s, "\n") + "\n")
194}
195
196// Stdin creates a pipe that reads from [os.Stdin].
197func Stdin() *Pipe {

Callers 13

ExamplePipe_BasenameFunction · 0.92
ExamplePipe_DirnameFunction · 0.92
TestColumnSelectsFunction · 0.92
ExamplePipe_ColumnFunction · 0.92
ExamplePipe_ConcatFunction · 0.92
ExampleSliceFunction · 0.92
ExamplePipe_BasenameFunction · 0.92
ExamplePipe_DirnameFunction · 0.92
ArgsFunction · 0.85
FindFilesFunction · 0.85

Calls 3

NewPipeFunction · 0.85
EchoFunction · 0.85
JoinMethod · 0.80

Tested by 10

ExamplePipe_BasenameFunction · 0.74
ExamplePipe_DirnameFunction · 0.74
TestColumnSelectsFunction · 0.74
ExamplePipe_ColumnFunction · 0.74
ExamplePipe_ConcatFunction · 0.74
ExampleSliceFunction · 0.74
ExamplePipe_BasenameFunction · 0.74
ExamplePipe_DirnameFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…