In the course of writing https://go.dev/cl/682717, we noticed that WriteGoSum causes mysterious failures that prevent gopls from reporting a type error. (I vaguely recall that the go command did not report an error for a malformed go.sum file in some case.)
The task of this issue us to uncomment the WriteGoSum call in the above CL, figure out why it causes the tests to fail, and make the necessary changes to either make it pass, or fail with an informative error.