코젤브

0. Windows vscode 환경 go 설치 본문

컴공의 일상/Go

0. Windows vscode 환경 go 설치

코딩하는 젤리 2024. 8. 27. 22:52

1. 자신의 os에 맞는 go 설치

https://go.dev/dl/

 

All releases - The Go Programming Language

 

go.dev

 

2. vscode 에서 확장 프로그램 설치 (go)

 

3. vscode의 view -> command palette(ctrl + shift + p) 여기서 설치하면
출력의 터미널(GO)로 하면 설치 진행되고 있다

 

view -> command palette(ctrl + shift + p) -> go install/update tools -> 모든 항목 체크 후 확인을 누르자 

설치가 완전히 완료된다면 아래처럼 뜬다

 

 

그럼 이제 새로운 폴더를 만들고 *.go 파일을 작성하자

package main
import "fmt"
func main() {
	fmt.Println("hello world")
}

 

그리고 터미널을 열어서 아래와 같이 GO를 실행시키기

$ go run hello-world.go
hello world

$ go build hello-world.go
$ ls
hello-world	hello-world.go

$ ./hello-world
hello world

 

성공적이다 예