1. $ go mod graph | ./bin/import-graph -output=dot-color | dot -Tsvg > output.svg
    1. $ go mod graph | ./bin/import-graph
    1. {"id":"golang.org/x/net","can_get_gitstats":true,"can_get_codecov":false,"can_run_tests":true,"git_url":"https://go.googlesource.com/net","git_last_commit":"2021-04-20","git_last_commit_days_since":1,"git_num_contributors":196,"has_tests":true,"has_test_files":true,"num_packages":33,"num_packages_with_tests":30,"num_packages_with_tests_files":30,"num_packages_tests_passed":30,"package_coverage_avg":25.9,"package_coverage_min":71.35666666666665}
    2. {"id":"golang.org/x/tools","can_get_gitstats":true,"can_get_codecov":false,"can_run_tests":false,"git_url":"https://go.googlesource.com/tools","git_last_commit":"2021-04-20","git_last_commit_days_since":1,"git_num_contributors":389}
    3. {"from":"github.com/gin-gonic/gin","to":"github.com/gin-contrib/sse"}
    4. {"from":"github.com/gin-gonic/gin","to":"github.com/go-playground/validator/v10"}
    5. ...
    1. $ go mod graph | ./bin/import-graph | jq -f
    1. ...
    2. {
    3. "id": "github.com/gin-gonic/gin",
    4. "can_get_git": true,
    5. "can_get_codecov": true,
    6. "can_get_goreportcard": true,
    7. "can_run_tests": true,
    8. "github_url": "https://github.com/gin-gonic/gin",
    9. "git_url": "https://github.com/gin-gonic/gin",
    10. "git_last_commit": "2021-04-21",
    11. "git_last_commit_days_since": 3,
    12. "git_num_contributors": 321,
    13. "codecov_url": "https://app.codecov.io/gh/gin-gonic/gin",
    14. "codecov_files": 41,
    15. "codecov_lines": 2036,
    16. "codecov_coverage": 98.67,
    17. "gotest_has_tests": true,
    18. "gotest_all_tests_passed": true,
    19. "gotest_num_packages": 6,
    20. "gotest_num_packages_with_tests": 4,
    21. "gotest_num_packages_tests_passed": 4,
    22. "gotest_package_coverage_avg": 98.9,
    23. "goreportcard_average": 0.99,
    24. "goreportcard_grade": "A+",
    25. "goreportcard_files": 82,
    26. "goreportcard_issues": 6,
    27. "files_has_benchmarks": true,
    28. "files_has_tests": true
    29. }
    30. ...

    For GitHub you need to set to set in environment GITHUB_IMPORT_GRAPH_TOKEN to your personal GitHub token. It does not need any permissions at all. It is needed for higher quota of GitHub API calls.

    Fallback dot renderer with simpler notation without HTML coloring.

    1. $ go mod graph | ./bin/import-graph -output=dot | dot -Tsvg > output.svg

    https://github.com/nikolaydubina/import-graph