What tool is used in Go Playground's import handling?

77 views
Skip to first unread message

Pratik Tamgole

unread,
Oct 19, 2023, 11:32:01 PM10/19/23
to golang-nuts
When I use packages, any packages in general, how does the import("fmt") line correct itself to include the used packages in the program? What tool is implemented here, I want to put the same in my editor.

Christian Stewart

unread,
Oct 20, 2023, 1:18:04 AM10/20/23
to Pratik Tamgole, golang-nuts

On Thu, Oct 19, 2023, 8:31 PM Pratik Tamgole <pratik...@gmail.com> wrote:
When I use packages, any packages in general, how does the import("fmt") line correct itself to include the used packages in the program? What tool is implemented here, I want to put the same in my editor.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/fbe12da2-c03e-4ff7-bf87-1207b483f89fn%40googlegroups.com.

Ian Lance Taylor

unread,
Oct 20, 2023, 9:08:06 AM10/20/23
to Pratik Tamgole, golang-nuts
On Thu, Oct 19, 2023 at 8:31 PM Pratik Tamgole <pratik...@gmail.com> wrote:
>
> When I use packages, any packages in general, how does the import("fmt") line correct itself to include the used packages in the program? What tool is implemented here, I want to put the same in my editor.

https://pkg.go.dev/golang.org/x/tools/cmd/goimports

Ian
Reply all
Reply to author
Forward
0 new messages