Skip to content

Instantly share code, notes, and snippets.

@sdboyer
Last active June 27, 2022 13:33
Show Gist options
  • Save sdboyer/a5efbe28da2f1a552065411d6e6ce492 to your computer and use it in GitHub Desktop.
Save sdboyer/a5efbe28da2f1a552065411d6e6ce492 to your computer and use it in GitHub Desktop.
Fails correctly - 0.1 is incompatible with 0.0
package foo
import "github.com/grafana/thema"
thema.#Lineage
name: "foo"
seqs: [
{
schemas: [
{// 0.0
// Init is a string. This comment goes with the field thru codegen
init: string
},
{// 0.1
// Init is a string. This comment goes with the field thru codegen
init: string
// newfield is a required field we've added, breaking backwards compatibility
newfield: int32
},
]
},
]
make gen-cue
generate code from .cue files
go generate ./pkg/framework/coremodel
could not process coremodel dir /Users/sdboyer/ws/grafana/pkg/coremodel: required field is optional in subsumed value: newfield (and 1 more errors)
exit status 1
pkg/framework/coremodel/interface.go:5: running "go": exit status 1
make: *** [gen-cue] Error 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment