보관함

vscode go Example실행

프로젝트용 폴더 생성

main.go 파일 생성

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

vscode 로 폴더 열기

F5 로 실행 -> Error

dlv 파일이 없어서 생긴 문제 인것 같아서 일단 delve 패키지 install

brew install delve

하지만 

go: go.mod file not found in current directory or any parent directory; see 'go help modules'

터미널에서

go env -w GO111MODULE=auto

F5 로 실행 및 디버깅

그리고 vscode의 환경설정에 아래 코드 추가

"go.toolsManagement.autoUpdate": true,

 

 

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

  

  

  

이 사이트는 Akismet을 사용하여 스팸을 줄입니다. 댓글 데이터가 어떻게 처리되는지 알아보세요.