1. GO LANGUAGE 설치 Window Version
Download and install - The Go Programming Language
Download and install Download and install Go quickly with the steps described here. For other content on installing, you might be interested in: 1. Go download. Click the button below to download the Go installer. Download Go Don't see your operating syste
golang.org
cd C:\GO //다운 받은 폴더 이동
go version // 버전 확인
go env
명령어를 통해 GOPATH를 확인할 수 있음 근데 GOPATH에 있는 C:\Users\user\go에는 go 폴더가 없습니다.
GOPATH 역할 : WORKSPACE 역할 - 소스코드를 받아와서 저장하거나 패키지를 컴파일하여 라이브러리 파일 생성시 해당 경로 기준으로 하고 있습니다.
그래서 해당 경로에 폴더를 만들어줍니다.
2. VISUAL STUDIO 설치 Window Version
Download Visual Studio Code - Mac, Linux, Windows
Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows. Download Visual Studio Code to experience a redefined code editor, optimized for building and debugging modern web and cloud applications.
code.visualstudio.com
그리고 GO EXTENSION을 설치하셔야 GO 편집기를 사용할 수 있습니다.
1.왼쪽 사이드바에서 5번째 아이콘 마켓플레이스에서 GO 검색
2.최상단 GO EXTENSION 설치
그리고 영어버전이 불편하신 경우
마켓 플레이스에서 KOREAN을 검색하신 후 설치하시면 최상단 KOREAN LANGUAGE 설치 후 다시 시작하시면 됩니다.
그리고 아까 GOPATH로 잡은 폴더 경로를 여셔서 새폴더 및 파일을 만드시고 코딩을 진행하시면 됩니다!
package main
import "fmt"
func main() {
s := []int{0, 1, 2, 3, 4, 5}
s = s[2:5]
fmt.Println(s)
}
그리고 간단한 코드 작성 후 디버깅 없이 실행 CTRL + F5 누르시면 환경 선택 후 실행이 됩니다.
이상 GO PROGRAMMING 환경 설정에 대해 마치겠습니다.
감사합니다.
'공부 > 개발' 카테고리의 다른 글
go 프로그래밍 - main 에러를 내다 (0) | 2020.11.16 |
---|---|
go 프로그래밍 - 2.채널 time.After() (0) | 2020.11.12 |
swap (0) | 2018.01.10 |
상속 (0) | 2017.12.27 |
헷갈리는 String (0) | 2017.12.26 |