encoding/gocode: use many fewer go/packages.LoadMode bits
We just need a package's name and type information.
We don't need its syntax nor do we need to load dependencies,
both of which multiply the cost of go/packages.
`go generate` for encoding/gocode drops from ~1.55s to ~0.45s
on my laptop after this change, which should help CI.
Currently, its `go generate ./...` step with a warm Go cache
is one of the slowest, clocking in at 12s.
Slow generation steps are particularly harmful as they are sequential.
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I06cc023bedfee5cadf5313cf001b35bce9f41af3
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1201336
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>