Skip to content

x/tools/cmd/goimports: does not work if there are spaces in the path #40482

@xorcare

Description

@xorcare

What version of Go are you using (go version)?

$ go version
go version go1.14.6 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/xor/Library/Caches/go-build"
GOENV="/Users/xor/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/xor/go"
GOPRIVATE=""
GOPROXY="direct"
GOROOT="/Users/xor/sdk/go1.14.6"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/xor/sdk/go1.14.6/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/xor/Documents/Source Code/golden/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/yh/x8t18v653t752p5nk400qt580000gn/T/go-build156301565=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I running command in /Users/xor/Documents/Source Code/golden:

test -z $(go list -f {{.Dir}} ./... | while read d; do goimports -e -l -local github.com/xorcare/golden -w "$d/*.go"; done)

goimports version: golang.org/x/tools v0.0.0-20200729173947-1c30660f9f89

What did you expect to see?

I want to see formatted imports...

What did you see instead?

test -z $(go list -f {{.Dir}} ./... | while read d; do goimports -e -l -local github.com/xorcare/golden -w "$d/*.go"; done)
stat /Users/xor/Documents/Source Code/golden/*.go: no such file or directory
stat /Users/xor/Documents/Source Code/golden/internal/integration/*.go: no such file or directory
stat /Users/xor/Documents/Source Code/golden/v2/*.go: no such file or directory
stat /Users/xor/Documents/Source Code/golden/v2/abstract/*.go: no such file or directory
stat /Users/xor/Documents/Source Code/golden/v2/goldenjson/*.go: no such file or directory
stat /Users/xor/Documents/Source Code/golden/v2/internal/cast/*.go: no such file or directory
stat /Users/xor/Documents/Source Code/golden/v2/internal/extension/*.go: no such file or directory
stat /Users/xor/Documents/Source Code/golden/v2/internal/goldenbuilder/*.go: no such file or directory
stat /Users/xor/Documents/Source Code/golden/v2/internal/testing/*.go: no such file or directory

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions