Skip to content

go#auto#template_autocreate fails on Windows if shell not cmd.exe #2712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
drichardson opened this issue Feb 10, 2020 · 1 comment · Fixed by #2713
Closed

go#auto#template_autocreate fails on Windows if shell not cmd.exe #2712

drichardson opened this issue Feb 10, 2020 · 1 comment · Fixed by #2713

Comments

@drichardson
Copy link
Contributor

What did you do? (required: The issue will be closed when not provided)

  1. On Windows, change .vimrc to set shell=pwsh
  2. vim example.go

What did you expect to happen?

Opens with new file template.

What happened instead?

"example.go" [New File]
Error detected while processing function go#auto#template_autocreate[6]..go#template#create[4]..go#tool#PackageName[1]..go#util#ExecInDir[9]..go#util#Exec[17]..<SNR>11_exec[7]..<SNR>11_system:
line   11:
E484: Can't open file C:/Users/doug/AppData/Local/Temp/VIo794.tmp
Error detected while processing function go#auto#template_autocreate[6]..go#template#create[4]..go#tool#PackageName[1]..go#util#ExecInDir[9]..go#util#Exec[17]..<SNR>11_exec[7]..<SNR>11_system:
line   11:
E484: Can't open file C:/Users/doug/AppData/Local/Temp/VIo794.tmp
Press ENTER or type command to continue

Configuration (MUST fill this out):

vim-go version:

d698de4

vimrc you used to reproduce (use a minimal vimrc with other plugins disabled; do not link to a 2,000 line vimrc):

vimrc
set nocompatible
filetype off

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
call vundle#end()

filetype plugin indent on

set shell=pwsh

Vim version (first three lines from :version):

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Feb 4 2020 23:03:05)
MS-Windows 64-bit console version
Included patches: 1-210

Go version (go version):

go version go1.13.7 windows/amd64

Go environment

go env Output:
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\doug\AppData\Local\go-build
set GOENV=C:\Users\doug\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\doug\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\doug\AppData\Local\Temp\go-build893694394=/tmp/go-build -gno-record-gcc-switches

gopls version

gopls version Output:
golang.org/x/tools/gopls v0.3.1
    golang.org/x/tools/[email protected] h1:yNTWrf4gc4Or0UecjOas5pzOa3BL0WDDyKDV4Wz5VaM=

@drichardson
Copy link
Contributor Author

I'm about to submit a PR for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant