Home - kyunghoj/golang GitHub Wiki
Windows 10 에서 Go 개발 환경 설정
설치하기
- Download and run the installer for your platform from https://golang.org/dl/
- https://golang.org/doc/install#windows
GOPATH
설정하기
Windows comes with a predefined environment variables called USERPROFILE
, which you can use to set your GOPATH
.
Open a new terminal window and enter the following:
setx GOPATH %USERPROFILE%\go
좀 더 전통적인 GUI 를 통한 GOPATH
설정:
Under Windows, you may set environment variables through the "Environment Variables" button on the "Advanced" tab of the "System" control panel. Some versions of Windows provide this control panel through the "Advanced System Settings" option inside the "System" control panel.
설치 확인
go version
으로 설치된 버전을 알 수 있다.
컴파일 해 보기
%GOPATH%\go\src\hello
라는 폴더를 만든다
hello.go
라는 파일을 만든다
package main
import "fmt"
func main() {
fmt.Printf("hello, world\n")
}
Then build it with the go
tool:
C:\Users\Gopher\go\src\hello> go build hello.go