You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does this issue reproduce with the latest release?
Yes
What did you do?
go mod tidy
go run .
cmp stdout stdout.golden
-- go.mod --
module mod.example
go 1.22.3
require cuelang.org/go v0.9.0
-- main.go --
package main
import (
"fmt"
"log"
"cuelang.org/go/cue"
)
func main() {
path := cue.MakePath(cue.Def("values"), cue.Str("api").Optional())
fmt.Printf("path: %v\n", path)
roundTrip := cue.ParsePath(path.String())
if err := roundTrip.Err(); err != nil {
log.Fatal(err)
}
fmt.Printf("roundTrip: %v\n", roundTrip)
}
-- stdout.golden --
path: #values.api?
roundTrip: #values.api?
What did you expect to see?
Passing test. The documentation for cue.ParsePath does not call out an exception for optional fields, so it seems reasonable to assume they can be parsed.
What did you see instead?
> go mod tidy
> go run .
[stdout]
path: #values.api?
[stderr]
main.go:15: expected 'EOF', found '?'
exit status 1
[exit status 1]
FAIL: /tmp/testscript1658982306/repro.txtar/script.txtar:2: unexpected go command failure
The text was updated successfully, but these errors were encountered:
What version of CUE are you using (
cue version
)?Does this issue reproduce with the latest release?
Yes
What did you do?
What did you expect to see?
Passing test. The documentation for
cue.ParsePath
does not call out an exception for optional fields, so it seems reasonable to assume they can be parsed.What did you see instead?
The text was updated successfully, but these errors were encountered: