Skip to content

Commit

Permalink
Revert "Add add & sub functions to template language"
Browse files Browse the repository at this point in the history
This reverts commit 6fa9d7b.

Signed-off-by: Christopher Obbard <[email protected]>
  • Loading branch information
obbardc committed Nov 27, 2023
1 parent 6fa9d7b commit 6f6598d
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions actions/recipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ The following custom template functions are available
- sector: Returns the argument * 512 (convential sector size) e.g. `{{ sector 64 }}`
- escape: Shell escape the argument `{{ escape $var }}`
- decimal: Returns the integer argument as a decimal integer e.g. `{{ decimal 0x40 }} => 64`
- add: Returns the calculation of two integer arguments `a + b`, e.g. `{{ add 1 1 }} => 2`
- sub: Returns the calculation of two integer arguments `a - b`, e.g. `{{ sub 10 1 }} => 9`
Mandatory properties for recipe:
Expand Down Expand Up @@ -163,14 +161,6 @@ func decimal(i int) int {
return i
}

func add(a int, b int) int {
return a + b
}

func sub(a int, b int) int {
return a - b
}

func DumpActionStruct(iface interface{}) string {
var a []string

Expand Down Expand Up @@ -259,8 +249,6 @@ func (r *Recipe) Parse(file string, printRecipe bool, dump bool, templateVars ..
"sector": sector,
"escape": escape,
"decimal": decimal,
"add": add,
"sub": sub,
}
t.Funcs(funcs)

Expand Down

0 comments on commit 6f6598d

Please sign in to comment.