Re:Cue, an open-source data validation language
by dqpb on Tuesday June 15, 2021 @12:37PM
(#27517887)
I would do it like this:
test.cue:
#Job: {
command: string
args: string
cli: "\(command) \(args)"
}
#GoJob: #Job & {
command: "go"
}
#GoJobV: #GoJob & {
args: "-v ./..."
}
job: #GoJobV.cli
Results in: $ cue export test.cue
{
"job": "go -v ./..."
}
How would you solve this with directory structure and "function structs" respectively? I'm having trouble wrapping my head around the former and ran into shadowing problems with the latter.