var cmdDownload … var downloadJSON … var downloadReuse … func init() { … } type ModuleJSON … func runDownload(ctx context.Context, cmd *base.Command, args []string) { … } // DownloadModule runs 'go mod download' for [email protected], // leaving the results (including any error) in m itself. func DownloadModule(ctx context.Context, m *ModuleJSON) error { … }