Skip to content

Commit

Permalink
feat(interpolate): add uuid support
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Velasco <ivan.velasco@socotra.com>
  • Loading branch information
ivan-velasco committed Jan 25, 2024
1 parent f56fb9f commit 2f628cd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sdk/interpolate/interpolate_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"encoding/base64"
"encoding/json"
"fmt"
"github.com/ovh/cds/sdk"
"net/url"
"path"
"reflect"
Expand Down Expand Up @@ -83,12 +84,13 @@ func init() {
}
return val
},
"div": func(a, b interface{}) int64 { return toInt64(a) / toInt64(b) },
"mod": func(a, b interface{}) int64 { return toInt64(a) % toInt64(b) },
"div": func(a, b interface{}) int64 { return toInt64(a) / toInt64(b) },
"mod": func(a, b interface{}) int64 { return toInt64(a) % toInt64(b) },
"ternary": ternary,
"urlencode": func(s string) string { return url.QueryEscape(s) },
"dirname": func(s string) string { return path.Dir(s) },
"basename": func(s string) string { return path.Base(s) },
"uuid": sdk.UUID(),
})
}

Expand Down

0 comments on commit 2f628cd

Please sign in to comment.