0
0
Goprogramming~10 mins

Go modules overview - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to initialize a new Go module.

Go
go [1] init example.com/mymodule
Drag options to blanks, or click blank then click option'
Amod
Binitmod
Cmodule
Dstart
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'go module init' instead of 'go mod init'.
Using 'go init' without 'mod'.
2fill in blank
medium

Complete the code to add a dependency to your Go module.

Go
go [1] get github.com/gin-gonic/gin@v1.7.7
Drag options to blanks, or click blank then click option'
Amod
Bget
Cinstall
Dadd
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'go mod install' which is not a valid command.
Using 'go add' which does not exist in Go tooling.
3fill in blank
hard

Fix the error in the command to tidy the module dependencies.

Go
go mod [1]
Drag options to blanks, or click blank then click option'
Atidy
Bclean
Cfix
Dupdate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'go mod clean' which is not a valid command.
Using 'go mod update' which does not exist.
4fill in blank
hard

Fill both blanks to print the current module's path and version.

Go
go [1] [2]
Drag options to blanks, or click blank then click option'
Alist
Bmod
C-m
Dinfo
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'go mod -m' which is not a valid command.
Using 'go mod info' which is not a valid flag.
5fill in blank
hard

Fill both blanks to upgrade a dependency to the latest version.

Go
go [1] github.com/pkg/errors@[2]
Drag options to blanks, or click blank then click option'
Aget
Bmod
Clatest
Dupgrade
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'go mod get' which is not a valid command.
Using 'latest' without '@' symbol.