aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/encoding/xml/marshal.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2022-03-16 10:31:57 -0700
committerIan Lance Taylor <iant@golang.org>2022-03-16 13:52:32 -0700
commit69921f4a7ec081c5b37dae13e3372003e4efd49f (patch)
tree3c485503e44039e60d49bc2450e9a28153496706 /libgo/go/encoding/xml/marshal.go
parent7fd6e36ea9aa8575841ff1da08b4aebc0298abe2 (diff)
downloadgcc-69921f4a7ec081c5b37dae13e3372003e4efd49f.zip
gcc-69921f4a7ec081c5b37dae13e3372003e4efd49f.tar.gz
gcc-69921f4a7ec081c5b37dae13e3372003e4efd49f.tar.bz2
libgo: update to final Go 1.18 release
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/393377
Diffstat (limited to 'libgo/go/encoding/xml/marshal.go')
-rw-r--r--libgo/go/encoding/xml/marshal.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/libgo/go/encoding/xml/marshal.go b/libgo/go/encoding/xml/marshal.go
index 6859be0..7792ac7 100644
--- a/libgo/go/encoding/xml/marshal.go
+++ b/libgo/go/encoding/xml/marshal.go
@@ -512,7 +512,7 @@ func (p *printer) marshalValue(val reflect.Value, finfo *fieldInfo, startTemplat
}
fv := finfo.value(val, dontInitNilPointers)
- if finfo.flags&fOmitEmpty != 0 && isEmptyValue(fv) {
+ if finfo.flags&fOmitEmpty != 0 && (!fv.IsValid() || isEmptyValue(fv)) {
continue
}