레이블이 vscode인 게시물을 표시합니다. 모든 게시물 표시
레이블이 vscode인 게시물을 표시합니다. 모든 게시물 표시

code editors

유료 IDE/editor 가 사용하기도 편하고 기능도 많지만 터미널 환경 + 무료 소프트웨어도 왠만한건 다되고 유료 못지 않게 편해서 이를 더 선호하는 편이다.
유료 에디터는 10년전 윈도우 환경 개발을 위해서 visual studio 사용이 마지막인것 같다.
요즘 많이 쓰는 jetbrains 제품은 사용하지 않는다.

예전에는 vscode 를 한참 썼는데 typescript/javascript 로 만들어서 그런지 뭔가 점점 무거워지고 느린 느낌이 들어 다시 vim 을 주로 사용하게 됐다.
neovim(nvim) 이 좀더 모던한 느낌이긴 한데 기존 vim 커스터마이징한 설정에 익숙해서 쉽게 nvim 으로 넘어가지 못하고 있다.
그러면서 가끔 vscode, neovim-lzayvim 의 command palette(커맨드를 검색해서 실행하는) 기능이 그리워 질때가 있다.

vscode 느낌이면서 가볍고 빠른 rust 로 다음 에디터들을 서브로 사용해 보려 한다.
참고로 요건 vim 에 영감을 받은 터미널 환경의 에디터들, amp는 요즘 관리가 안되고 있어 왠지 사라질것 같다.

zed, lapce 둘다 깃헙 좋아요가 30K 가 넘고, vscode 처럼 커맨드 팔렛트, 익스텐션(아직 개수는 많지 않음)을 사용할 수 있어 좋다.

아톰 만든 사람이 rust 로 만들었다는 zed
cmd+shift+p -> toggle vim mode

lapse 는 디폴트 단축키들이 vscode 많이 비슷해서 최종 낙점!ㅎ
[lapse default short cut]
cmd+shift+p -> enable modal editing (like vim)
cmd+shift+e toggle file explorer
cmd+shift+x toggle plugin focus
cmd+shift+f toggle search focus
cmd+= zoom in
cmd+- zoom out
cmd+] indent line  
cmd+[ outdent line
cmd+p goto file(fuzzy file finder)
alt+up move line up
alt+down move line down
ctrl+- jump location backward
ctrl+shift+- jump location forward
ctlr+` toggle terminal
alt+shift+i insert cursor end of line(multi cursor)
f2 rename
f12 goto definition

FOSS FLOSS license

FOSS(free and open-source software) 
FLOSS(free/libre/open-source software)
이 라이센스들은 사용, 수정, 복사등을 자유롭게 할 수 있다.

vscode FLOSS 라이센스가 아니라고 명확하게 말하고 있다.
때문에 https://vscodium.com/ 를 준비해놓았다.

많이 사용되는 라인센스들
수정,삭제가 자유로움: MIT, BSD, Apach2.0
약간의 제약: LGPLv2.1, LGPLv3, MPL
강한 제약: GPLv2, GPLv3

delete leftover data on mac

# 맥용량이 부족할 땐 임시,캐시 파일들을 삭제해보자.

# diskonaut 로 보니 이미 삭제된 vscode 관련 데이터가 크게 남아 있었다.
# 앱 캐시와 앱에서 사용하는 데이터 위치다.
/Users/ysoftman/Library/Caches
/Users/ysoftman/Library/Application Support

# 각각 10G 정도의 데이터가 남아 있어서 다음과 같이 삭제했다.
rm -rf /Users/ysoftman/Library/Caches/Code
rm -rf "/Users/ysoftman/Library/Application Support/vscode-cpptools"

# go mod pkgs 캐시 크기가 꽤된다. 
go clean -modcache

# vagrant box 이미지
rm -rf ~/.vagrant.d/boxes/*

# app cache 확인
cd ~/Library/Containers
fd -t d Caches | dust -d1

# app cache 삭제
fd -t d Caches --exec rm -rf {} \;

golangci-lint cpu usage

# vscode 로 golang 을 오픈하면 갑자기 컴이 버벅거린다.
# 아래 프로세스가 CPU 를 모두 사용하고 있었다.
golangci-lint run --print-issued-lines=false --out-format=colored-line-number --issues-exit-code=0

# golangci-lint 커맨드 설명을 보면 기본 16core 를 사용하고 있다.
-j, --concurrency int           Concurrency (default NumCPU) (default 16)

# vscode 설정을 요렇게 변경해보자.
"go.lintTool": "golangci-lint",
"go.lintFlags": ["--concurrency 4"],

mac ApplePressAndHoldEnabled

# mac vscode 사용시 영문,숫자키를 누르고 있으면 입력이 계속지 않고 1번만 된다.
# 이때는 앱에 ApplePressAndHoldEnabled 를 비활성화해 적용하면 된다.
# 다음 명령 실행후 vscode 종료(cmd+q) 후 다시 시작하면
# 영문,숫자키를 누르고 있으면 계속 입력된다.
defaults write -g com.microsoft.VSCode ApplePressAndHoldEnabled -bool false

python unused import

# python 작업시 오타등으로 의도하지 않은 패키지가 자동 import 되는 경우가 있다.
# 존재하지 않거나 사용하지 않는 패키지가 import 된 경우 찾기

# autoflake 사용
# pip3 install autoflake
# --remove-all-unused-imports 사용 안하는 import 부분 화면 출력
# --in-place 를 사용하면 화면 출력 대신 파일에 바로 적용
fd .py ./aaa | xargs autoflake --remove-all-unused-imports --in-place 

# pylint 사용
# pip3 install pylint
# W0611 (unused-import)
fd .py ./aaa | xargs pylint --disable="all" --enable="W0611"

# 추가로 vscode pylint 설정시
"python.linting.pylintEnabled": true,
"python.linting.pylintArgs": [
  "--disable=all",
  "--enable=W0611",
],

vscode python no definition found

# vscode python 사용시 로컬 특정 경로의 패키지를 찾지 못해
# 모듈, 함수등에 'go to definition'(F12) 수행시 다음과 같이 찾을 수 없다고 나온다.

No Definition found for 'xxxxx'

# File > Save Workspace As... 로 워크스페이스 파일을 다음과 같이 생성하자. 
# ysoftman.code-workspace 내용
{
"folders": [
{
"path": "."
},
],
"settings": {
"python.envFile": "${workspaceFolder}/local.env",
}
}

# 그리고 local.env 파일에 생성하고 PYTHONPATH 에 찾지 못하는 패키지 경로를 설정한다.
PYTHONPATH=../my_custom_pkg1:../my_custom_pkg2:

# 이제 workspace file 로 열면 go to definition 이 동작한다.
code ./ysoftman.code-workspace

# 참고

vscode clang-format style

# vscode c++ 포맷 스타일은 기본적으로 clang-format 을 사용한다.
# 포맷 스타일은 변경 예시
// linux 에선 clang 설치해야 다음을 사용할 수 있다.
"C_Cpp.clang_format_path": "/usr/local/bin/clang-format",
// .clang-format 파일이 있다면 이 설정에 따른 포맷팅
"C_Cpp.clang_format_style": "file",
// clang-format --style="google" aaa.cpp 로 사용
// .clang-format 파일이 없다면 사용할 포맷 스타일 디폴트 "Visual Studio"
"C_Cpp.clang_format_fallbackStyle": "visual studio",
// "C_Cpp.clang_format_fallbackStyle": "google",
// "C_Cpp.clang_format_fallbackStyle": "webkit",
// "C_Cpp.clang_format_fallbackStyle": "mozilla",

# 포맷 스타일 결과 비교, main 함수만 발췌
# 개인적으로 visualstudio 또는 google 스타일이 좋은것 같다.

# Visual Studio 는 Clang-format 기본스타일 종류에는 없고 다음과 같이 설정해야한다.
# clang-format --style="{UseTab: Never,IndentWidth: 4,
BreakBeforeBraces: Allman,
AllowShortIfStatementsOnASingleLine: false,
IndentCaseLabels: false,
ColumnLimit: 0}" hello_world.cpp
# 참고로 -i 옵션을 주면 변경된 스타일이 파일에 적용된다.
# 들여쓰기 탭, 시작 중괄호 한줄 차지
int main()
{
    string a = "1";
    if (a == "1")
    {
        cout << "hello world" << endl;
    }
    return 0;
}

# clang-format --style="google" hello_world.cpp
# 들여쓰기 공백2, 시작 중괄호 같은 라인에 시작
int main() {
  string a = "1";
  if (a == "1") {
    cout << "hello world" << endl;
  }
  return 0;
}

# clang-format --style="webkit" hello_world.cpp
# 들여쓰기 공백4, 함수 시작 중괄호만 한줄, 함수내에서는 같은 라인에 시작
int main()
{
    string a = "1";
    if (a == "1") {
        cout << "hello world" << endl;
    }
    return 0;
}

# clang-format --style="mozilla" hello_world.cpp
# 들여쓰기 공백2, 함수 시작 중괄호만 한줄, 함수내에서는 같은 라인에 시작
# 함수 리턴 타임 한줄 차지
int
main()
{
  string a = "1";
  if (a == "1") {
    cout << "hello world" << endl;
  }
  return 0;
}

golang 1.16 go.sum 에러

# go.sum 은 go.mod 에 명시된 패키지들을 다운로드 후 각 패키지를 해시값으로 표시해
# 추후 로컬 패키지가 정상인지(변조,오염되지는 않았는지) 파악하는 체크썸 파일이다.
# 가끔 go.sum 을 커밋을 하지 않는(.gitignore 에 명시해서) 경우가 있는데
# go.sum 을 커밋해 다른 동료들과 패키지 버전을 맞출 수 있도록 해야 한다.

# 빌드는 되지만 vscode 에 다음과 같은 에러 메시지가 보였다.

error while importing github.com/stretchr/testify/assert: missing go.sum entry for module providing package github.com/pmezard/go-difflib/difflib (imported by github.com/stretchr/testify/assert); to add:
go get github.com/stretchr/testify/assert@v1.6.1compiler

missing go.sum entry for module providing package github.com/tidwall/match (imported by github.com/tidwall/gjson); to add:
        go get github.com/tidwall/gjson@v1.6.0

# 필요없는 패키지를 정리(tidy)해도 에러 메시지가 발생한다.
go mod tidy

# 원인은 go 1.13 버전을 사용하다 1.16 버전으로 명시된 go.mod 를 사용해서다.
# go.sum 체크썸 확인해보니 내 로컬의 mod cache(GOPATH/pkg/mod)가 go 1.13 으로 되어 있어 문제가 됐다.
# vscode IDE 에서 go.sum 기반으로 자동으로 잘못된 부분을 에러로 표시하고 있었다.

# 현재 go 1.16 임을 확인하고
go version
go version go1.16 darwin/amd64

# 다음 명령으로 다운로드된 패키지로 로컬 캐시를 업데이트 하면 된다.
go mod download

# 참고로
# go 1.15 까지는 -mod=mod 가 디폴트였지만
# go 1.16 부터 -mod=readonly 가 디폴트로, go.mod, go.sum 를 업데이트를 위해선
# 명시적으로 (go build, go test 등 사용시) -mod=mod 를 명시해야 한다.

wsl bash completion is too slow

# wsl(windows subsystem for linux) 의 bash 탭으로 파일 자동 완성을 시도하면 너무 오래걸리는 문제가 있다.
bash ./a탭... 한참 후 파일 자동완성

# 터미널을 하나 더 열어 이전 터미널의 bash 탭 동작의 system call 을 살펴보면
# /mnt/c/windows 경로들의 수많은 파일들을 찾고 있는 것을 볼 수 있다.
strace -p 이전터미널pid

# path 환경변수 설정에 /mnt/c/windows 경로가 포함되어 있는 것이 문제였다.
echo $PATH
/mnt/c/Program Files/Intel/iCLS Client/:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/
...

# path 에서 /mnt/c/windows... 경로들을 빼고 재설정하면 빠르게 자동완성 된다.

# 이 이슈가 등록되어 있고,
# 배포판(ubuntu 등)의 /etc/wsl.conf 파일을 생성하고 다음 옵션값을 설정하면
# /mnt/c/window 등 윈도우 경로들이 추가되지 않는다.
sudo vi /etc/wsl.conf
[interop]
appendWindowsPath=false

# cmd -> wsl 배포판 상태를 확인
C:\Users\Administrator>wsl -l -v
  NAME            STATE           VERSION
* Ubuntu-18.04    Running         2

# 배포판을 terminate 시킨다.
C:\Users\Administrator>wsl -t ubuntu-18.04

# 이제 wsl 배포판(ubuntu)를 다시 시작하면
# path 환경변수에서 윈도우 경로가 빠져있고 bash 자동완성이 빠르게 동작한다.

# appendWindowsPath=false 옵션으로 윈도우 관련 경로들이 제외됐기 때문에
# wsl 에서 vscode 를 code . 실행을 위해선 아래 경로를 추가해야 한다.

vscode path wildcard

# vscode 에서 .yml 파일이 위치에 따라 yaml 또는 ansible 로 사용해야 한다.
# **ansible, **roles 이름의 디렉토리내에 있는 .yml, .yaml 경우 ansible 로 지정 할 수 있다.
# 이때 path 에 대한 와일드카드로 **(double asterisk)를 사용한다.
# 파일 연결 및 제외 사용 예시
{
    "files.associations": {
        "**/roles/**/*.yml": "ansible",
        "**/ansible/**/*.yml": "ansible",
        "**/roles/**/*.yaml": "ansible",
        "**/ansible/**/*.yaml": "ansible",
        "*.yml.*": "yaml"
    },
    "files.exclude": {
        "**/.git": true,
        "**/.svn": true
    }
}

vscode rust language server 문제

# vscode 에서 RLS(rust language server) 플러그인을 사용한다.
https://marketplace.visualstudio.com/items?itemName=rust-lang.rust

# 그런데 상태 바에 RLS starting 계속 진행중이되면서
# formatting, completion 등이 동작하지 않는다.
# 원인은 cargo 로 생성한 여러 프로젝트들을 하나의 vsocde 에서 열게 되서 발생한것이다.
# 현재는 RLS 가 동작하려면 vscode 의 최상위(root)위치에 cargo.toml 이 있어야 한다.
# 해당 이슈는 현재 수정 중으로 좀더 있으면 개선 될것 같다.
https://github.com/rust-lang/rls-vscode/pull/601

# 참고로 단순히 하나의 프로젝트만 vscode 로 열면 잘 동작한다.
# 그리고 이때 RLS 설치가 되면 다시 멀티 프로젝트를 열었을때
# 빌드 등은 안되지만 formatting, completion 등은 작동한다.

vscode c++ template 연속 angle bracket 에러

# c++ 사용중 다음과 같이 중첩 template 사용시 >(angle bracket)이 연속으로 붙어 있는 경우
vector<vector<int>>

# mac에서 vscode problems 창에 다음과 같은 에러메시지가 나오고 있다.
a space is required between consecutive right angle brackets (use '> >')

# template 연속 angle bracket 에러는 c++11 에서 수정돼 컴파일시 문제가 없다.
# vscode 설정에서 다음과 같이 또는 c++14, c++17 등 상위버전을 설정했지만 계속 에러메시지가 보인다.
"C_Cpp.default.cppStandard": "c++11",

# 이밖에도 c++11 의 auto type 사용할 수 없다는 다음의 에러가 발생한다.
'auto' type specifier is a C++11 extension [-Wc++11-extensions]

# 해결방법
# vscode > open settings (JSON) > 에서 다음과 같이 clang 컴파일러의 -std=c++11 을 명시하면 된다.
"clang.cxxflags": [
    "-std=c++11"
]

vscode 원격 개발

# vscode 1.35 부터 remote develop extension 을 설치해
# ssh, docker container, wsl 의 원격 개발 환경을 이용 할 수 있다.
# 참고로 아이콘도 좀 심플하게(예쁘게) 변경됐다.~ㅎ

# 원격 접속은 원격 서버의 ${HOME}/.vscode-server 프로그램을 설치하고 vscode-server 가 실행돼 원격으로 접속하게 된다.
# vscode-server 는 wget 로 다운로드를 하게 되는데
# 참고로 사내망이라면 http_proxy 환경 변수를 설정 해줘야 한다.

# docker container 가 이미 떠있는 경우
remote-containers : attach to running container
-> 현재 떠있는 컨테이너 선택 -> 새 vscode 창이 오픈

# 새 vscode 가 생성되면 컨테이너의 소스 파일을 열어 볼 수 있고,
# vscode 터미널에서 빌드 커맨드 등을 실행할 수 있는 상태가 된다.

# remote ssh 는 ~/.ssh/config 와 ~/.ssh/authorized_keys 사용한다.
# kerberos 인증 환경에서도 접속할 수 있다.
# settings.json 설정에 다음을 추가하면 로그인 터미널 상태를 표시해준다.
"remote.SSH.showLoginTerminal": true

# 로그인 터미널에 다음과 같은 에러가 발생하는 경우
channel 2: open failed: administratively prohibited: open failed

# 대상 호스트 서버의 /etc/ssh/sshd_config 에 tcp 포워딩 가능하도록 설정한다.
AllowTcpForwarding yes

# 그리고 sshd 서버를 재시작한다.
sudo systemctl restart sshd

# 기타 접속 이슈 해결방법 참고
https://code.visualstudio.com/docs/remote/troubleshooting#_troubleshooting-hanging-or-failing-connections

# remote develop 기능은 vscode live share(로컬 코드를 공유)와 비슷하지만
# 원격 장비의 코드를 vscode 로 볼 수 있어 좋은것 같다.

vscode godef 느림 현상

# vscode go extension 는 godef 툴을 설치해 함수 정의 부분을 찾을 수 있다.
# godef 커맨드라인에서 사용
# godef 는 파일에서 찾을 단어(identifier)를 offset 으로 입력받는다.
# vscode show-offset extension 을 설치하면 상태바에 offset:xxx 로 확인할 수 있다.
# time 으로 수행시간 측정, godef -t 타입정보보기, -f 파일, -o 오프셋
time godef -t -f main.go -o 2214

# 위와 같이 커맨드를 사용하며 빠르게 위치를 출력해주지만
# vscode go to definition(정의로 가기, F12)에서는 3초가 걸린다.
# godef 수동으로 설치해보자
# gomodule 사용하는 경우 다음과 같이 설치하면 $GOPATH/bin/godef 가 생긴다.
GO111MODULE=on go get -u github.com/rogpeppe/godef

# 이제 vscode 정의로 가기하면 빨리 된다.
# godef 저장소에 에 go.mod가 있어서인지 GO111MODULE=on 으로 설치하면
# 새로운 godef 바이너리가 설치되면서 조금 빨라졌다.
# 하지만 1초가 넘어가는것이 아직도 좀 느리것 같다.
time godef -t -f main.go -o 2214
godef -t -f main.go -o 2214  1.15s user 0.58s system 313% cpu 0.552
total

# 같은 이슈인것 같은데 위 방법으로 해결되지 않는 경우가 있다.
# godef 는 내부적으로 go list 사용하고 여기서 시간을 많이 잡는것 같다.
# -trace 옵션으로 trace 파일을 만들고
time godef -t -f main.go -o 2214 -trace out.trace
# http://127.0.0.1:xxxx -> Syscall blocking profile 항목을 확인해보면
go tool trace out.trace
https://github.com/rogpeppe/godef/issues/114#issuecomment-478680734

go 1.11 modules 사용하기

# go1.11 부터 지원되는 패키지지 관리자 modules 이 추가되었다.
# go modules 은 GOPATH, vendor 대신 GOPATH/pkg/mod 에 패키지를 다운로드 한다.
# go go modules 는 아직 실험단계로
# 사용하기 위해선 다음과 같이 환경변수 설정이 되어야 한다.
# 또는 매번 go 명령시 GO111MODULE=on 를 명시
GO111MODULE=on

# go modules 를 사용하면 go.mod 파일로 패키지를 명시한다.
# go.mod 생성
go mod init

# 다음 go 명령을 수행하면 go.mod 파일에
# semantic 버전으로 패키지가 명시된다.
go build
go test
go list
module example.com/m
require (
    golang.org/x/text v0.3.0
    gopkg.in/yaml.v2 v2.1.0
)

# untagged revision(Pseudo-versions) 은 다음과 같은 형식으로 생성된다.
v0.0.0-yyyymmddhhmmss-abcdefabcdef

# 빌드 필요한 전체 패키지보기
go list -m all

# go test, go build 등으로 패키지 새로 다시 받을 경우
# modules cache 와 go.sum(패키지 변경 사항 비교를 위한) 파일을 삭제해야 한다
sudo rm -rf $GOPATH/pkg/mod/cache
rm -f go.sum
go test ./...

# ./vendor 디렉토리 패키지를 사용해서 빌드하는 경우
go build -mod=vendor

# 기타 자세한 내용은 go v1.11 에서
go help modules

# go.mod 특정 버전, 커밋을 추가할때
https://golang.org/cmd/go/#hdr-Module_queries
# 다음과 같이 커밋 해시를 사용하면 해당 커밋상태를 go.mod 를 추가한다.
go get github.com/gorilla/mux@e3702bed2

# go 1.13 부터는 GO111MODULE=auto 가 디폴트로 설정되어 있다.
GO111MODULE=auto 는
현재 프로젝트가 GOPATH 안에 있으면 GO111MODULE=off
현재 프로젝트가 GOPATH 밖에 있으면 GO111MODULE=on
으로 동작한다.

# GO111MODULE=on 이면 GOPATH 가 아닌 경로에서 프로젝트(디렉토리)를 구성할 수 있다.
# GOPATH 안에 프로젝트를 만들면 자동으로 모듈명을 파악해 go.mod
# go mod init 이 다음과 같이 GOPATH 밖에 있어 모듈 경로를 명시해야 하는 경우
go: cannot determine module path for source directory /home/ysoftman/workspace/test_code/golang/wordcount (outside GOPATH, module path must be specified)

# 다음같이 모듈명을 직접 명시해야 한다.
go mod init wordcount


#####


# vscode-go extension 사용시 다음과 같이 추가해주자.
"go.toolsEnvVars": {
    "GO111MODULE": "on"
},

# vscode-go 에서 go.formatTool 로
# goimports 또는 goreturns(gofmt+goimports) 사용시 module 을 찾지 못해 import 에서 자동 삭제되는 문제가 있다.
https://github.com/Microsoft/vscode-go/issues/1532#issuecomment-402294022
# 최신 툴로 업데이트 하니 아직 미해결상태다.
go get -u golang.org/x/tools/...

vscode c++ formatting 적용하기

# vscode cpp extenstion 을 설치하고 코드 포맷팅을 하면 엉뚱하게 포맷팅이 된다.
# 이유는 포맷팅 환경이 설정되어 있지 않아서이다.
# 우선 clang-format 을 설치하자.
brew install clang-format

# 사용자설정(settings.json) 을 다음과 같이 설정한다.
"C_Cpp.clang_format_path": "/usr/local/bin/clang-format",

# 현재 프로젝트에 .clang-format 파일을 읽어 들인다.
"C_Cpp.clang_format_style": "file",

# format_style 실패시 기본 셋팅(Visual Studio, LLVM, Google, Chromium, Mozilla, WebKit)
"C_Cpp.clang_format_fallbackStyle": "Visual Studio"

# 참고

mac golang delve 문제

# mac 10.12 버전으로 업데이트 되면서 vscode 에서 golang debug 가 실행되지 않는다.
# golang debugger 인 delve 에서 발생하는 문제로 다음과 같은 에러가 발생하며 실행되지 않는다.
cannot get thread count

# 현재 brew 로 설치 가능한 delve 버전은 다음과 같고 아직 수정사항이 반영되지 않았다.
Version: 0.11.0-alpha


# 해결방법
# 우선 다음과 같은 방식으로 gopath 에 소스를 다운받는다.
go get -v -u github.com/peterh/liner github.com/derekparker/delve/cmd/dlv

# 이슈가 해결된 665브랜치로 변경하여 설치한다.
cd $GOPATH/src/github.com/derekparker/delve
git fetch origin pull/665/head
git checkout FETCH_HEAD
CERT=dlv-cert make install

# 참고로 빌드된 delve 파일은 다음과 같이 생성되며 gopath 를 통해 사용된다.
/Users/ysoftman/workspace/gopath/bin/dlv

vscode spawn ENOTDIR 에러 문제

vscode go extension(lukehoban) 을 설치 후 다음과 같은 에러가 발생하였다.

Error: Error: spawn ENOTDIR
vscode 에서 ctrl(cmd) + shift + p --> tools developer tools 를 실행해보면 아래 그림과 같은 에러가발생하고 있는것을 알 수 있다.


원인은 "go.goroot" 경로 설정이 잘못되 발생한 문제로 경로를 root (go 설치된)경로 제대로 수정하면 발생하지 않는다.

vscode python formatting 사용하기

# vscode python 익스텐션을 설치후 설정을 보면 autopep8 로 포맷팅하도록 되어 있다.
// Provider for formatting. Possible options include 'autopep8' and 'yapf'.
"python.formatting.provider": "autopep8",

# autopep8 설치 (Python Enhancement Proposals)
pip install pep8

# yaf 설치 (Yet Another Python Formatter)
pip install yapf

# 포맷팅 적용
# vscode 1.7 부터 editor.action.format -> editor.aciton.formatDocument 로 변경되었다.
shift + alt + f

# 참고
https://github.com/DonJayamanne/pythonVSCode/wiki/Formatting
https://code.visualstudio.com/updates