현재 3권의 신간들인 Go Optimizations 101, Go Details & Tips 101Go Generics 101이 출간되어 있습니다. Leanpub 서점에서 번들을 모두 구입하시는 방법이 비용 대비 효율이 가장 좋습니다.

Go에 대한 많은 정보들과 Go 101 책들의 최신 소식을 얻으시려면 Go 101 트위터 계정인 @Go100and1을 팔로잉 해주세요.

GoTV

GoTV is an abbreviation of Go Toolchain Version. It is a tool used to manage and use multiple coexisting installations of official Go toolchain versions harmoniously and conveniently.

Project page: https://github.com/go101/gotv

Please follow @Go100and1 to get the latest news of GoTV (and all kinds of Go details/facts/tips/...).

Installation

Run

go install go101.org/gotv@latest

to install GoTV.

A 1.17+ toolchain version is needed to finish the installation. The toolchain version may be uninstalled after pinning a suitable toolchain version (see below).

Usage

Run gotv without any arguments to show help messages.

Most gotv commands are in the following format:

gotv ToolchainVersion [go-arguments...]

During running the first such a command, the Go git repository will be cloned (which needs several minutes to finish).

ToolchainVersion might be

Examples:

$ gotv 1.17. version
[Run]: $HOME/.cache/gotv/tag_go1.17.13/bin/go version
go version go1.17.13 linux/amd64

$ gotv 1.18.3 version
[Run]: $HOME/.cache/gotv/tag_go1.18.3/bin/go version
go version go1.18.3 linux/amd64

$ cat main.go
package main

const A = 3

func main() {
	const (
		A = A + A
		B
	)
	println(A, B)
}

$ gotv 1.17. run main.go
[Run]: $HOME/.cache/gotv/tag_go1.17.13/bin/go run main.go
6 6

$ gotv 1.18.3 run main.go
[Run]: $HOME/.cache/gotv/tag_go1.18.3/bin/go run main.go
6 12

Other gotv commands:

# sync the local Go git repository with remote
gotv fetch-versions

# list all versions seen locally
gotv list-versions

# build and cache some toolchain versions
gotv cache-version ToolchainVersion [ToolchainVersion ...]

# uncache some toolchain versions to save disk space
gotv uncache-version ToolchainVersion [ToolchainVersion ...]

# pin a specified toolchain version at a stable path
gotv pin-version ToolchainVersion

# unpin the current pinned toolchain version
gotv unpin-version

Pin a toolchain version

We can use the gotv pin-version command to pin a specific toolchain version to a stable path. After adding the stable path to the PATH environment veriable, we can use the official go command directly. And after doing these, the toolchain versions installed through ways other than GoTV may be safely uninstalled.

It is recommanded to pin a 1.17+ version for bootstrap purpose now. The following example shows how to pin Go toolchain version 1.17.13:

$ gotv pin-version 1.17.
[Run]: cp -r $HOME/.cache/gotv/tag_go1.17.13 $HOME/.cache/gotv/pinned-toolchain

Please put the following shown pinned toolchain path in
your PATH environment variable to use go commands directly:

	/home/username/.cache/gotv/pinned-toolchain/bin

After the prompted path is added to the PATH environment variable, open a new terminal window:

$ go version
go version go1.17.13 linux/amd64

The command gotv pin-version .! will upgrade the pinned toolchain to the latest release version (which may be a beta or rc version).

Set a bootstrap toolchain version

To build a toolchain verision, another already built toolchain version is needed to be used in the building process. The other toolchain version is called the bootstrap version.

Some facts:

Currently, GoTV uses the toolchain set in the PATH environment variable as the bootstrap version by default. If GOROOT_BOOTSTRAP environment variable is set, then its value will be used.


The Go 101 프로젝트는 Github 에서 호스팅됩니다. 오타, 문법 오류, 부정확한 표현, 설명 결함, 코드 버그, 끊어진 링크와 같은 모든 종류의 실수에 대한 수정 사항을 제출하여 Go 101을 개선을 돕는 것은 언제나 환영합니다.

주기적으로 Go에 대한 깊이 있는 정보를 얻고 싶다면 Go 101의 공식 트위터 계정인 @go100and1을 팔로우하거나 Go 101 슬랙 채널에j가입해주세요.

Go 101의 저자인 Tapir는 2016년 7월부터 Go 101 시리즈 책들을 집필하고 go101.org 웹사이트를 유지 관리하고 있습니다. 새로운 콘텐츠는 책과 웹사이트에 수시로 추가될 예정입니다. Tapir는 인디 게임 개발자이기도 합니다. Tapir의 게임을 플레이하여 Go 101을 지원할 수도 있습니다. (안드로이드와 아이폰/아이패드용):
  • Color Infection (★★★★★), 140개 이상의 단계로 이루어진 물리 기반의 캐주얼 퍼즐 게임
  • Rectangle Pushers (★★★★★), 2가지 모드와 104개 이상의 단계로 이루어진 캐주얼 퍼즐 게임
  • Let's Play With Particles, 세가지 미니 게임이 있는 캐주얼 액션 게임
페이팔을 통한 개인 기부도 환영합니다.