Closed jvsteiner closed 5 years ago
Are you sure you don't have multiple goimports
binaries lying round?
If I go get
it now, I still see the -srcdir
flag.
$ env GOPATH=/tmp go get golang.org/x/tools/cmd/goimports
$ /tmp/bin/goimports -h
usage: goimports [flags] [path ...]
-cpuprofile string
CPU profile output
-d display diffs instead of rewriting files
-e report all errors (not just the first 10 on different lines)
-l list files whose formatting differs from goimport's
-local string
put imports beginning with this string after 3rd-party packages; comma-separated list
-memprofile string
memory profile output
-memrate int
if > 0, sets runtime.MemProfileRate
-srcdir dir
choose imports as if source code is from dir. When operating on a single file, dir may instead be the complete file name.
-trace string
trace profile output
-v verbose logging
-w write result to (source) file instead of stdout
rebuilt using go get -u
must have had an old version in my src dir, but didnt have the binary installed.
loving margo, btw
I migrated to dev branch, got margo running and chose
goimports
. after installing the latest version of goimports fromgolang.org/x/tools/cmd/goimports
when I save a file, I am seeing in the console:A little digging reveals that the goimports command must have changed -
-srcdir
is not the correct command. it prints to stdout by default, with no flags, which is apparently what is required, as changing-srcdir
to-w
failed with: (and didn't modify the file)removing it entirely also didn't work - in fact it simply rewrote the original, saved version of the file, undoing modifications that I made. I think thats because the goimports is being run on the persisted version of the file, before the save, not after.