Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Avoid calling go list #419

@linzhp

Description

@linzhp

@plakhotnii @codyoss

go list is quite slow because it has to download external dependencies. This becomes more problematic under Bazel execution environment when GOCACHE is not available (bazel-contrib/rules_go#2366). I found all mockgen need from go list is the package path. Why not deduce the package path from source file or directory in mockgen, using logic like:

If GO111MODUE==off: 
   find the relative path from GOPATH
else:
  find the closest go.mod and add the relative path from the go.mod to the module name
  if no go.mod exist and GO111MODUE != on:
    find the relative path from GOPATH

Related to #396

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions