Skip to content

Commit

Permalink
adding new pipe function
Browse files Browse the repository at this point in the history
  • Loading branch information
pratikmota committed Oct 4, 2024
1 parent 2569ed6 commit c8ebfbf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions evaldo/builtins_pipes.go
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,15 @@ var Builtins_pipes = map[string]*env.Builtin{
},
},

"new": {
Argsn: 0,
Doc: "new creates a new pipe with an empty reader.",
Fn: func(ps *env.ProgramState, arg0 env.Object, arg1 env.Object, arg2 env.Object, arg3 env.Object, arg4 env.Object) env.Object {
newPipe := script.NewPipe()
return *env.NewNative(ps.Idx, newPipe, "script-pipe")
},
},

// GOPSUTIL

}

0 comments on commit c8ebfbf

Please sign in to comment.