Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upcmd/go: track tools/tooling updates to support modules #24661
Comments
gopherbot
added this to the vgo milestone
Apr 3, 2018
rsc
changed the title from
x/vgo how to works with tools like guru ?
to
x/vgo: integrate with guru, goimports, etc
Apr 3, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rsc
Apr 3, 2018
Contributor
Yes, this is an issue we're very aware of. Will leave this open to track it.
|
Yes, this is an issue we're very aware of. Will leave this open to track it. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
myitcv
Apr 7, 2018
Member
@rsc - just to check this issue effectively encapsulates what we discussed in golang-dev?
|
@rsc - just to check this issue effectively encapsulates what we discussed in |
myitcv
changed the title from
x/vgo: integrate with guru, goimports, etc
to
x/vgo: integrate with guru, goimports, and other tools
Apr 9, 2018
myitcv
changed the title from
x/vgo: integrate with guru, goimports, and other tools
to
x/vgo: integrate with guru, goimports, and other tools/tooling
Apr 9, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
myitcv
Apr 9, 2018
Member
Changed the title so that this issue matches on use of the words "tool", "tools" or "tooling"
Will keep a list of tools here too (please edit):
- Requiring build output:
gurugocodestringer
- Requiring source code
goimportsgodef- godoc.org (golang/gddo#567)
|
Changed the title so that this issue matches on use of the words "tool", "tools" or "tooling" Will keep a list of tools here too (please edit):
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
gopherbot
Apr 9, 2018
Change https://golang.org/cl/105855 mentions this issue: x/vgo: add deplist command to get build information about (test) deps
gopherbot
commented
Apr 9, 2018
|
Change https://golang.org/cl/105855 mentions this issue: |
This was referenced Apr 9, 2018
added a commit
to myitcv/vgo
that referenced
this issue
Apr 30, 2018
added a commit
to myitcv/vgo
that referenced
this issue
May 20, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rsc
Jun 6, 2018
Contributor
See https://go-review.googlesource.com/c/tools/+/116359 for a sketch of a start.
/cc @alandonovan
|
See https://go-review.googlesource.com/c/tools/+/116359 for a sketch of a start. |
rsc
modified the milestones:
vgo,
Go1.11
Jul 12, 2018
rsc
added
the
modules
label
Jul 12, 2018
rsc
changed the title from
x/vgo: integrate with guru, goimports, and other tools/tooling
to
cmd/go: integrate with guru, goimports, and other tools/tooling
Jul 12, 2018
rsc
referenced this issue
Jul 20, 2018
Closed
go/build: Import does not find source directory for code in modules #26504
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
gopherbot
Jul 20, 2018
Change https://golang.org/cl/125296 mentions this issue: go/build: invoke go command to find modules during Import, Context.Import
gopherbot
commented
Jul 20, 2018
|
Change https://golang.org/cl/125296 mentions this issue: |
pushed a commit
that referenced
this issue
Jul 28, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
myitcv
Aug 1, 2018
Member
@alandonovan @ianthehat - is it worth creating a number of issues, specific to each tool that's being worked on?
I keep directing people to this umbrella issue... but maybe there's merit in getting a bit more granularity on things? Equally, maybe not.
So I'm definitely wouldn't push back if you said "let's keep things here"
|
@alandonovan @ianthehat - is it worth creating a number of issues, specific to each tool that's being worked on? I keep directing people to this umbrella issue... but maybe there's merit in getting a bit more granularity on things? Equally, maybe not. So I'm definitely wouldn't push back if you said "let's keep things here" |
sam3d
referenced this issue
Aug 2, 2018
Open
cmd/go: add a facility to peek into the module cache #26717
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
sam3d
Aug 2, 2018
How about the case of goimports importing packages that are both:
- Within the module's local directory
- Outside of the system scoped
$GOPATH
Assuming the following directory structure:
./
├── go.mod
├── main.go
└── test
└── test.go
With ./go.mod containing:
module example.com
goimports will happily leave alone and even format ./main.go:
package main
import (
"log"
"example.com/test"
)
func main() {
log.Print("Hello, world!")
test.Start()
}With ./test/test.go:
package test
import "fmt"
func Start() {
fmt.Println("Started properly")
}However, if the "example.com/test" import is removed from main.go, it wont get added or found again. If its import path is changed in any way to render it incorrect (say to "example.com/tes"), goimports simply deletes the line.
It's odd - goimports can clearly tell that package test exists when it's been provided already, but it can't actively seek and add it if it hasn't been.
Is this something that requires looking into the module cache for, or is this a different issue?
sam3d
commented
Aug 2, 2018
•
|
How about the case of
Assuming the following directory structure:
With
package main
import (
"log"
"example.com/test"
)
func main() {
log.Print("Hello, world!")
test.Start()
}With package test
import "fmt"
func Start() {
fmt.Println("Started properly")
}However, if the It's odd - Is this something that requires looking into the module cache for, or is this a different issue? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ianthehat
Aug 2, 2018
goimports will assume that the import line "example.com/test" imports a package called test if it cannot find any sources for that package, and it knows the test symbol is used, so it won't delete the line. It does not mean that it knew the package existed...
goimports scans your GOPATH and GOROOT, anything not there it will not find right now.
It will be made to use x/tools/go/packages plus some extra stuff that is beyond the scope of that package. When it does, this case will work (does not involve the module cache, just the list of packages in the current module, which you can already get with go mod -packages
ianthehat
commented
Aug 2, 2018
|
It will be made to use x/tools/go/packages plus some extra stuff that is beyond the scope of that package. When it does, this case will work (does not involve the module cache, just the list of packages in the current module, which you can already get with |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
sam3d
Aug 2, 2018
Thank you for explaining @ianthehat! I've misunderstood how goimports handles symbols.
sam3d
commented
Aug 2, 2018
|
Thank you for explaining @ianthehat! I've misunderstood how |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
metakeule
Aug 11, 2018
I have two questions:
- will
x/tools/go/packagesmove to the standard library with Go 1.12? - I can't see any information about the version of a plugin, so how is a tool that assists in importing (like GoSublime) supposed to get a list of possible imports (with versions)?
metakeule
commented
Aug 11, 2018
|
I have two questions:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
metakeule
Aug 11, 2018
Also: How to prevent that import completion will get really slow with larger projects? (see mdempsky/gocode#32)
metakeule
commented
Aug 11, 2018
•
|
Also: How to prevent that import completion will get really slow with larger projects? (see mdempsky/gocode#32) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
myitcv
Aug 11, 2018
Member
will x/tools/go/packages move to the standard library with Go 1.12?
The plan is for it to move to the standard library at some point, yes, once it has stabilised (ref).
I can't see any information about the version of a plugin
This is similar to the goimports "problem"; see #26717
How to prevent that import completion will get really slow with larger projects?
Many of the problems describe in mdempsky/gocode#32 relate to speed problems brought about by the use of the -source flag, which drives the use of the source importer. go/packages will work using the underlying build cache and so should not suffer these problems.
But in case lag does become an issue for gocode with its current architecture, go/packages will be offering support for long-running programs. So it's conceivable that gocode's cache will switch to be module-based, where it effectively "watches" for relevant changes and refreshes its cache accordingly. Its cache will then be primed for fast responses to ad-hoc queries.
cc @dominikh (in case there's any overlap of interest here with your work)
The plan is for it to move to the standard library at some point, yes, once it has stabilised (ref).
This is similar to the
Many of the problems describe in mdempsky/gocode#32 relate to speed problems brought about by the use of the But in case lag does become an issue for cc @dominikh (in case there's any overlap of interest here with your work) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ianthehat
Sep 3, 2018
I have modified this issue to track the full list of tools, and assigned it to me.
I did this rather than file a new issue because it seems this issue is already referenced in quite a few places. I apologies to @flibustenet for deleting all your words, but this seems like the most practical approach.
Feel free to file individual tracking issues for each tool where needed, and to add any tools not in the list.
We will continue to update this issue moving forwards.
ianthehat
commented
Sep 3, 2018
•
|
I have modified this issue to track the full list of tools, and assigned it to me. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
agnivade
Sep 3, 2018
Member
@ianthehat - Could you take a look at #26827 and close it if you think it falls under this issue ?
|
@ianthehat - Could you take a look at #26827 and close it if you think it falls under this issue ? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
aarzilli
Sep 3, 2018
Contributor
dlv
Delve 1.1.0 works with Go 1.11 and as far as I know doesn't have any problem with modules. I just tried with a toy example and everything seemed to work. If you are aware of something I'd like to know.
It just calls go build and uses the output executable, btw.
Delve 1.1.0 works with Go 1.11 and as far as I know doesn't have any problem with modules. I just tried with a toy example and everything seemed to work. If you are aware of something I'd like to know. |
fhs
referenced this issue
Sep 3, 2018
Closed
x/tools/cmd/stringer: Does not work with Go modules #27456
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ianthehat
Sep 4, 2018
@agnivade : godoc is a special beast with all sorts of module issues.
We intend to fix godoc (or an alternative) so that the usage an IDE makes of it works as part of this issue, and possibly fixing the single session local web server variant, but fully fixing godoc in all it's flavours to be module and version aware is a whole separate task, and probably needs its own issue outside of this one.
ianthehat
commented
Sep 4, 2018
|
@agnivade : godoc is a special beast with all sorts of module issues. |
This was referenced Sep 7, 2018
agnivade
referenced this issue
Sep 14, 2018
Open
x/tools/godoc: Allow shallow directory listing #27666
added a commit
to 13k/go-steam-resources
that referenced
this issue
Sep 17, 2018
solumos
referenced this issue
Sep 25, 2018
Open
Imports Incompatible with Go 1.11 Module Support #29
bradfitz
referenced this issue
Sep 25, 2018
Closed
x/tools/imports: does not find imports from go.mod #27865
added a commit
to jeremyschlatter/go-ethereum
that referenced
this issue
Sep 26, 2018
added a commit
to jeremyschlatter/go-ethereum
that referenced
this issue
Sep 26, 2018
jeremyschlatter
referenced this issue
Sep 26, 2018
Merged
accounts/abi/bind: stop using goimports in the binding generator #17768
ramya-rao-a
referenced this issue
Sep 30, 2018
Open
(go modules) gotype-live doesn't recognize imports in go modules #1950
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
e-dard
Oct 4, 2018
I have been using a next branch on staticcheck that seems to be working very well with modules. Maybe link it on the list on the PR description?
e-dard
commented
Oct 4, 2018
|
I have been using a next branch on staticcheck that seems to be working very well with modules. Maybe link it on the list on the PR description? |
flibustenet commentedApr 3, 2018
•
edited by myitcv
Many Go tools that previously worked with GOPATH need to be upgraded in order to work with modules.
This is a tracking issue for the conversion of tools to work with modules