1
0
mirror of https://github.com/golang/go synced 2024-09-30 20:38:32 -06:00
Commit Graph

1 Commits

Author SHA1 Message Date
Rob Findley
daa6538899 internal/lsp/source: fix panic in formatZeroValue for invalid type
formatZeroValue is currently only used when formatting return values for
statement completion. Per golang/go#40956, it must be possible to hit
this codepath with an invalid type.

In this case, the empty string seems like a reasonable value. Perhaps we
could do better, but fix the panic for now.

Fixes golang/go#40956

Change-Id: I45b559d41001c857cef34aea2a5ac4a9096fe950
Reviewed-on: https://go-review.googlesource.com/c/tools/+/249818
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2020-08-21 17:11:49 +00:00