Tutorial
Start Go lang tutorial!!
Go Documentation 의 튜토리얼 따라해보며 Go 구조를 경험해보자.
Documentation - Getting Started
모듈 관리
Go lang 은 언어 자체에서 모듈 관리를 한다. 따라서 GOROOT 경로 안에서 코드를 작성해야 새로운 모듈을 추가할 수 있고 Go lang이 해당 코드, 모듈의 위치를 알 수 있다. 하지만 Go Modules를 추가하면 GOROOT 경로 외에서도 모듈을 import 할 수 있다.
Go Modules
go mod init
creates a new module, initializing thego.mod
file that describes it.go build
,go test
, and other package-building commands add new dependencies togo.mod
as needed.go list -m all
prints the current module’s dependencies.go get
changes the required version of a dependency (or adds a new dependency).go mod tidy
removes unused dependencies.
Last updated
Was this helpful?