VSCode로 Golang을 설정하는 방법
그래서 처음부터 신선한 마음으로 세팅해봤습니다😊
제가 사용한 환경은 아래와 같습니다.
Go 설치
다음 링크에서 Go를 다운로드하여 설치합니다.

설치 후 터미널을 열고 다음 명령어를 사용하여 버전을 확인합니다.
$ go version
go version go1.15.2 darwin/amd64
GOPATH 설정을 위한 디렉토리를 생성합니다.
$ mkdir ~/go
GOPATH 환경 변수의 경우
~/.bash_profile
에 다음 줄을 추가합니다.export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$PATH
비주얼 스튜디오 코드 설치
다음 링크에서 VSCode를 다운로드하여 설치합니다.
설치 후 VSCode를 실행합니다.
Extensions Marketplace(
Cmd+Shift+X
)를 열고 Go
를 검색하여 설치합니다.
명령 팔레트(
Cmd+Shift+P
)를 열고 Go: Install/Update Tools
명령을 실행합니다.
여기에 나열된 모든 Go 확장 프로그램을 설치합니다.

코딩 시작
VSCode에서 생성
hello.go
package main
import "fmt"
func main() {
fmt.Println("Hello, world!")
}
기본적으로 코드 저장을 위한 자동 완성 및 서식이 활성화되어 있습니다. 훌륭합니다.

터미널(
Ctrl+`
)을 열고 다음 명령을 실행합니다.$ go run hello.go
Hello, world!
재미있게 보내세요!👍
Reference
이 문제에 관하여(VSCode로 Golang을 설정하는 방법), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/ko31/how-to-setup-golang-with-vscode-1i4i텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)