Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type List ¶
List is a pipe/line producer/transformer to list the files/folders in a folder
func (List) P ¶
P is the producer
Example ¶
package main import ( "github.com/MasteryConnect/pipe/extras/fs" "github.com/MasteryConnect/pipe/line" "github.com/MasteryConnect/pipe/message" "github.com/MasteryConnect/pipe/x" ) func main() { line.New().SetP( fs.List{ Root: "/", IncludeDirs: true, ExcludeFiles: true, Recursive: false, }.P, ).Add( line.I(func(m interface{}) (interface{}, error) { msg := m.(message.FileInfo) if msg.IsDir() { return "**dir**", nil } return m, nil }), x.Head{N: 1}.T, // limit the list to just 1 for output testing line.Stdout, ).Run() }
Output: **dir**
Click to show internal directories.
Click to hide internal directories.