WhoIsSethDaniel / goldsmith.nvim

Use Neovim features, such as built-in LSP and tree-sitter, and develop Go code.
MIT License
57 stars 3 forks source link

Very slow startup with go 1.18 #31

Open seanrmurphy opened 2 years ago

seanrmurphy commented 2 years ago

Following discussion on #11 ,I concluded that what I'm seeing is a more specific issue.

The upgrade from go 1.17.11 to 1.18.3 resulted in an increase in LunarVim startup time from about 1s to something over 8s. I confirmed that this is a goldsmith specific issue - if I remove goldsmith from my config.lua, startup time drops to some hundreds of ms.

I also note that GoInstallBinaries seems to fail:

Goldsmith: GoInstallBinaries: starting retrieval of gofumpt
Goldsmith: GoInstallBinaries: starting retrieval of golangci-lint
Goldsmith: GoInstallBinaries: starting retrieval of golines
Goldsmith: GoInstallBinaries: starting retrieval of gomodifytags
Goldsmith: GoInstallBinaries: starting retrieval of gopls
Goldsmith: GoInstallBinaries: starting retrieval of gotests
Goldsmith: GoInstallBinaries: starting retrieval of impl
Goldsmith: GoInstallBinaries: starting retrieval of jsontostruct
Goldsmith: GoInstallBinaries: starting retrieval of revive
Goldsmith: GoInstallBinaries: starting retrieval of staticcheck
Goldsmith: GoInstallBinaries: FAILED in retrieval of gofumpt, code 1
Goldsmith: GoInstallBinaries: FAILED in retrieval of golines, code 1
Goldsmith: GoInstallBinaries: FAILED in retrieval of golangci-lint, code 1
Goldsmith: GoInstallBinaries: FAILED in retrieval of gotests, code 1
Goldsmith: GoInstallBinaries: FAILED in retrieval of impl, code 1
Goldsmith: GoInstallBinaries: FAILED in retrieval of gomodifytags, code 1
Goldsmith: GoInstallBinaries: FAILED in retrieval of json-to-struct, code 1
Goldsmith: GoInstallBinaries: FAILED in retrieval of gopls, code 1

However, if I run go install github.com/segmentio/golines@latest from command line, it works.

I guess it's most likely some issue with my go configuration but it's still not clear to me what this could be.

WhoIsSethDaniel commented 2 years ago

The failure is interesting. ATM I can't guess what it would be. As I mentioned in #11 I am using 1.18.3, but without this extreme startup delay.

WhoIsSethDaniel commented 2 years ago

You may want to turn on debugging and bring up the :GoDebugConsole after running :GoInstallBinaries. To turn on debugging you need a configuration file that has system.debug set to true:

require('goldsmith').config {
    system = {
       debug = true,
    },
}