Documentation
¶
Overview ¶
Package filepath ports Go's path/filepath package to google/go-jsonnet's native functions.
Example ¶
vm := jsonnet.MakeVM() vm.NativeFunction(filepath.Base("filepath.base")) code := `std.native("filepath.base")("foo/hello.txt")` result, err := vm.EvaluateAnonymousSnippet("test.jsonnet", code) if err != nil { log.Fatal(err) } var a []any if err := json.Unmarshal([]byte(result), &a); err != nil { log.Fatal(err) } fmt.Printf("%v %v\n", a[0], a[1])
Output: hello.txt <nil>
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.