Some checks failed
/ Test (basic) on ubuntu-latest with golang 1.23 (push) Has been cancelled
/ Test (race) on ubuntu-latest with golang 1.23 (push) Has been cancelled
/ Test (shell) on ubuntu-latest with golang 1.23 (push) Has been cancelled
This lets us look at the available resource data for collection, and to filter it so we can decide what we want to collect on our machine. Other types of collect functions could be added in the future.
17 lines
484 B
Plaintext
17 lines
484 B
Plaintext
-- main.mcl --
|
|
import "fmt"
|
|
# unfortunately, for now `in` is a reserved keyword, see:
|
|
# https://github.com/purpleidea/mgmt/issues/728
|
|
$map = 55
|
|
$fn = func($in) { # in is a special keyword
|
|
13
|
|
}
|
|
test fmt.printf("%d", $fn(0)) {}
|
|
func fn($in) { # in is a special keyword
|
|
42 + $map
|
|
}
|
|
test fmt.printf("%d", $fn(0)) {}
|
|
test fmt.printf("%d", fn(0)) {}
|
|
-- OUTPUT --
|
|
# err: errLexParse: parser: `syntax error: unexpected IN, expecting MAP_IDENTIFIER or IDENTIFIER or COLLECT_IDENTIFIER` @5:2
|