We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Originally opened by @yuzhichang in cuelang/cue#1060
cue version
$ cue version cue version v0.4.0 linux/amd64
//poc_cue.go package main import ( "fmt" "cuelang.org/go/cue" ) type ab struct{ A, B int } var r cue.Runtime var x ab func main() { conf := `{ A: 6 # B shall be no less than 3 B: 2, } ` i, _ := r.Compile("test", conf) _ = i.Value().Decode(&x) fmt.Println(x) } $ go run poc_cue.go panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x688e26] goroutine 1 [running]: panic(0x6ded80, 0x919b30) /usr/local/go/src/runtime/panic.go:1065 +0x565 fp=0xc000287e78 sp=0xc000287db0 pc=0x4354c5 runtime.panicmem() /usr/local/go/src/runtime/panic.go:212 +0x5b fp=0xc000287e98 sp=0xc000287e78 pc=0x43351b runtime.sigpanic() /usr/local/go/src/runtime/signal_unix.go:734 +0x173 fp=0xc000287ed0 sp=0xc000287e98 pc=0x44a4d3 cuelang.org/go/cue.(*Instance).Value(0x0, 0x729e80, 0x4, 0x6cb480) /home/zhichyu/go/pkg/mod/cuelang.org/go@v0.4.0/cue/instance.go:213 +0x26 fp=0xc000287f28 sp=0xc000287ed0 pc=0x688e26 main.main() /home/zhichyu/notes/code/poc_cue2.go:23 +0x85 fp=0xc000287f88 sp=0xc000287f28 pc=0x6a6585 runtime.main() /usr/local/go/src/runtime/proc.go:225 +0x256 fp=0xc000287fe0 sp=0xc000287f88 pc=0x438116 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1371 +0x1 fp=0xc000287fe8 sp=0xc000287fe0 pc=0x4684c1
The text was updated successfully, but these errors were encountered:
Original reply by @yuzhichang in cuelang/cue#1060 (comment)
I forget to check the returned error of r.Compile. Sorry.
r.Compile
Sorry, something went wrong.
No branches or pull requests
Originally opened by @yuzhichang in cuelang/cue#1060
What version of CUE are you using (
cue version
)?What did you do?
The text was updated successfully, but these errors were encountered: