internal/rosa/azalea: store the zero value for nil
Test / Create distribution (push) Failing after 49s
Test / ShareFS (push) Failing after 1m29s
Test / Sandbox (push) Failing after 2m26s
Test / Sandbox (race detector) (push) Failing after 3m1s
Test / Hakurei (push) Failing after 3m24s
Test / Hakurei (race detector) (push) Failing after 5m19s
Test / Flake checks (push) Skipped
Test / Create distribution (push) Failing after 49s
Test / ShareFS (push) Failing after 1m29s
Test / Sandbox (push) Failing after 2m26s
Test / Sandbox (race detector) (push) Failing after 3m1s
Test / Hakurei (push) Failing after 3m24s
Test / Hakurei (race detector) (push) Failing after 5m19s
Test / Flake checks (push) Skipped
This is not final, but the behaviour is acceptable for now. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -115,7 +115,7 @@ func (e TypeError) Is(err error) bool {
|
||||
}
|
||||
|
||||
// storeE is a convenience function to set the value of a result pointer.
|
||||
func storeE(rp any, r any) error {
|
||||
func storeE(rp, r any) error {
|
||||
pv := reflect.ValueOf(rp).Elem()
|
||||
v := reflect.ValueOf(r)
|
||||
pt, vt := pv.Type(), v.Type()
|
||||
@@ -226,6 +226,9 @@ func evaluateAny(d PF, s []Frame, expr, rp any) bool {
|
||||
case "false":
|
||||
store(rp, false)
|
||||
return true
|
||||
case "nil":
|
||||
reflect.ValueOf(rp).Elem().SetZero()
|
||||
return true
|
||||
default:
|
||||
return evaluateAny(d, s, v, rp)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user