1
0
mirror of https://github.com/go-task/task.git synced 2025-06-15 00:15:10 +02:00

feat: pass ast.Call by reference

This commit is contained in:
Pete Davison
2024-01-26 14:34:18 +00:00
parent 65fdb618aa
commit 1ef5cf71d0
13 changed files with 138 additions and 137 deletions

View File

@ -17,16 +17,16 @@ import (
// CompiledTask returns a copy of a task, but replacing variables in almost all
// properties using the Go template package.
func (e *Executor) CompiledTask(call ast.Call) (*ast.Task, error) {
func (e *Executor) CompiledTask(call *ast.Call) (*ast.Task, error) {
return e.compiledTask(call, true)
}
// FastCompiledTask is like CompiledTask, but it skippes dynamic variables.
func (e *Executor) FastCompiledTask(call ast.Call) (*ast.Task, error) {
func (e *Executor) FastCompiledTask(call *ast.Call) (*ast.Task, error) {
return e.compiledTask(call, false)
}
func (e *Executor) compiledTask(call ast.Call, evaluateShVars bool) (*ast.Task, error) {
func (e *Executor) compiledTask(call *ast.Call, evaluateShVars bool) (*ast.Task, error) {
origTask, err := e.GetTask(call)
if err != nil {
return nil, err