GithubHelp home page GithubHelp logo

Comments (15)

fatih avatar fatih commented on May 21, 2024

I've pushed a change that it doesn't produce any error anymore if you set it, however you still can use GoUpdateBinaries. Please try it and report how it works for you.

from vim-go.

yacoob avatar yacoob commented on May 21, 2024

Works fine. Thanks for a quick fix :)

from vim-go.

yacoob avatar yacoob commented on May 21, 2024

Actually, I spoke too early. I still get this complaint:

vim.go: $GOPATH is not set
Press ENTER or type command to continue

I'm not sure whether it's caused by vim-go trying to autoinstall things, or something else - I get it even when I just launch vim, without any files present on the command line.

from vim-go.

fatih avatar fatih commented on May 21, 2024

This is normal. You have to set GOPATH to install the binaries. Therefore this is ok.

And when you launch vim-go it tries to auto install. You are going to see this error until you disable it.

from vim-go.

yacoob avatar yacoob commented on May 21, 2024

Sometimes my vim is running without GOPATH set. In those cases I'd rather have the auto-install fail silently, rather than have me press enter before it starts up.

from vim-go.

fatih avatar fatih commented on May 21, 2024

There is no functionality for that and I don't want to fail silently, sorry there. What you can do there:

  1. Disable auto install completely
  2. Use :GoUpdateBinaries to install the necessary tools

Also the binareis are installed once and never touched again. I don't know why you don't want to disable auto install, because it will prevent it.

from vim-go.

yacoob avatar yacoob commented on May 21, 2024

I don't have a problem with manually installing binaries, and I'll probably end up doing so. As for GOPATH warning - as I've mentioned earlier, more often than not there's no GOPATH in my environment (and I can't point one that will always be true). In those situations, regardless of whether the binaries are installed or not, vim will stop on startup and complain as mentioned above. I don't like that :)

from vim-go.

fatih avatar fatih commented on May 21, 2024

Did you try disabling auto install? Because it will prevent showing the GoPath warning. If you see the warning still means there is something else wrong.

from vim-go.

yacoob avatar yacoob commented on May 21, 2024

There's no warning when auto install is disabled. It works as expected.
There's a warning when auto install is enabled and GOPATH is unset, regardless of whether binaries are already installed or not.

from vim-go.

fatih avatar fatih commented on May 21, 2024

Ok, the think is the warning needs to be there, because otherwise go install will fail by default if there is no GOPATH. To prevent it vim-go fails earlier with the warning to set GOPATH. It's needed basically. Sorry that there is no middle ground for you. You can remove those lines from install.vim file and never see. But as I said it doesn't make sense when there is no GOPATH and auto install is enabled, probably it will fail.

from vim-go.

yacoob avatar yacoob commented on May 21, 2024

Now that :GoUpdateBinaries works, I'm OK :)

One extra idea: can you delay the initialization of vim-go (and as such - auto-installation of necessary binaries) till a *.go file is opened? This way things would get faster overall (no stuff done during startup) and my scenario would be mostly addressed :D

from vim-go.

fatih avatar fatih commented on May 21, 2024

Yeah, I have some plans (such as moving and structuring the functions under autoload). Also ftplugin is a need instead of plugin. Thanks for pointing out :)

Btw the autoinstall is just once. You could the install and then disable it. It will never again report it.

from vim-go.

yacoob avatar yacoob commented on May 21, 2024

Cool. Is there a chance you can update this bug when you implement this delayed init? Unless there's another bug I can track...?

from vim-go.

apporc avatar apporc commented on May 21, 2024

I don't think it's a good idea to show a warning every time a user invoke vim.
Maybe one doesn't even want to install go for now, maybe he just want to include go language support for his vim, and it's for future use.
A syntax plugin shouldn't have so tight relationship with it's language.

Nevertheless, this is just my personal opinion, hope it is not useless.
BTW, thanks for the excellent job.

from vim-go.

fatih avatar fatih commented on May 21, 2024

@apporc you are definetly right about that. Vim-go is mainly for people who code in Go rather than view Go code. That's why the plugin is built around this idea. If you just want syntax feature have a look at:

https://github.com/google/vim-ft-go

Is it still asking every time for question to install it?

from vim-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.