Skip to content

Commit 3d20bbe

Browse files
committed
internal/gcimporter: add a missing return if objectpath fails
The export data encoding was not symmetric in the case where objectpath fails. Fixes golang/go#61670 Change-Id: Ifaaa8eaed7ee5e28aa3b5ee7e9600b9e379e1968 Reviewed-on: https://go-review.googlesource.com/c/tools/+/514355 gopls-CI: kokoro <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Hyang-Ah Hana Kim <[email protected]> Run-TryBot: Robert Findley <[email protected]>
1 parent c16d0be commit 3d20bbe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/gcimporter/iexport.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -929,10 +929,11 @@ func (w *exportWriter) objectPath(obj types.Object) {
929929
// that export/import is producing a correct package.
930930
//
931931
// TODO: remove reportf once we have such confidence.
932-
objectPath = ""
932+
w.string("")
933933
if w.p.reportf != nil {
934934
w.p.reportf("unable to encode object %q in package %q: %v", obj.Name(), obj.Pkg().Path(), err)
935935
}
936+
return
936937
}
937938
w.string(string(objectPath))
938939
w.pkg(obj.Pkg())

0 commit comments

Comments
 (0)