feat: go list all pkgs and cache them to improve build speed
gop compiler is much slower than go
This PR optimization: reduce the number of times to execute the go list command to improve construction speed
Use this command to optimize the map cache: exec Command ("go", "list", "- f", "{{. ImportPath}}", {{. Export}} "," - export "," all ")
befor:
after:
Codecov Report
Attention: Patch coverage is 90.47619% with 4 lines in your changes are missing coverage. Please review.
Project coverage is 95.99%. Comparing base (
18cd65e) to head (27b6a9f). Report is 7 commits behind head on main.
:exclamation: Current head 27b6a9f differs from pull request most recent head aced8c5. Consider uploading reports for the commit aced8c5 to get more accurate results
| Files | Patch % | Lines |
|---|---|---|
| packages/imp.go | 90.47% | 3 Missing and 1 partial :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #397 +/- ##
==========================================
- Coverage 96.16% 95.99% -0.18%
==========================================
Files 15 15
Lines 6076 6111 +35
==========================================
+ Hits 5843 5866 +23
- Misses 177 186 +9
- Partials 56 59 +3
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
See https://github.com/goplus/gogen/blob/main/packages/cache/cache.go