Repository: github.com/vovs03/mymodule
Lesson 3
go mod init github.com/<myname></myname>/mymodule
-
инициализация модуля
-
go mod tidy
-
Обновление зависимостей модуля
-
go list -mod=mod -m all
-
Просмотр всех зависимостей
-
go mod graph
mymodule [master] % go mod graph
github.com/vovs03/mymodule github.com/gorilla/[email protected]
github.com/vovs03/mymodule github.com/valyala/[email protected]
github.com/valyala/[email protected] github.com/andybalholm/[email protected]
github.com/valyala/[email protected] github.com/klauspost/[email protected]
github.com/valyala/[email protected] github.com/valyala/[email protected]
github.com/valyala/[email protected] github.com/valyala/[email protected]
github.com/valyala/[email protected] golang.org/x/[email protected]
github.com/valyala/[email protected] golang.org/x/[email protected]
github.com/valyala/[email protected] golang.org/x/[email protected]
github.com/klauspost/[email protected] github.com/golang/[email protected]
golang.org/x/[email protected] golang.org/x/[email protected]
golang.org/x/[email protected] golang.org/x/[email protected]
golang.org/x/[email protected] golang.org/x/[email protected]
golang.org/x/[email protected] golang.org/x/[email protected]
golang.org/x/[email protected] golang.org/x/[email protected]
golang.org/x/[email protected] golang.org/x/[email protected]
golang.org/x/[email protected] golang.org/x/[email protected]
golang.org/x/[email protected] golang.org/x/[email protected]
golang.org/x/[email protected] golang.org/x/[email protected]
golang.org/x/[email protected] golang.org/x/[email protected]
golang.org/x/[email protected] golang.org/x/[email protected]
golang.org/x/[email protected] golang.org/x/[email protected]
golang.org/x/[email protected] golang.org/x/[email protected]
go mod why -m github.com/andybalholm/brotli
-
Проверить ветвь графа до конкретного модуля можно, использовав команду why:
-
mymodule [master●] % go mod why -m github.com/andybalholm/brotli
# github.com/andybalholm/brotli
github.com/vovs03/mymodule
github.com/valyala/fasthttp
github.com/andybalholm/brotli
Для создания визуального графа зависимостей была использована утилита modv
-
go mod graph | modv | dot -T png | open -f -a /Applications/Preview.app
Результат