$: << File.join(File.dirname(__FILE__), "/../lib") require 'rubygems' require 'twog' require 'rss' require 'simplecov' include Twog if ENV['COVERAGE'] require 'simplecov' SimpleCov.start end def test_conf @conf = {'rss_feed' => 'rss feed', 'bitly_username' => 'username', 'bitly_api_key' => 'api key', 'consumer_key' => 'consumerkey', 'consumer_secret' => 'consumersecret', 'access_token' => 'accesstoken', 'access_secret' => 'accesssecret', 'last_blog_post_tweeted' => '31 Mar 2010 07:52:17 -0600'} end def rss_feed_entry entry=<<-EOS Gocode Vim Plugin and Go Modules

Update: My friend Eli Uriegas let me know that you don’t need gocode anymore since vim-go has autocompletion. I tested it out and he is correct. Here is his tweet with a link to his dotfiles on how he sets up his .vimrc to use vim-go

Original Post:

I recently purchased Let’s Go from Alex Edwards. I wanted an end-to-end Golang website tutorial. It has been great. Lots learned.

Unfortunately, he is using Go’s modules and the version of the gocode Vim plugin I was using did not support Go modules.

Solution:

Use this fork of the gocode Vim plugin and you’ll get support for Go modules.

I use Vim Plug for my Vim plugins. Huge fan of Vundle but I like the post-actions feature of Plug. I just had to change one line of my vimrc and re-run updates.

diff --git a/vimrc b/vimrc index 3e8edf1..8395705 100644 --- a/vimrc +++ b/vimrc @@ -73,7 +73,7 @@ endif  let editor_name='nvim' Plug 'zchee/deoplete-go', { 'do': 'make'} endif - Plug 'nsf/gocode', { 'rtp': 'vim', 'do': '~/.config/nvim/plugged/gocode/vim/symlink.sh' } + Plug 'stamblerre/gocode', { 'rtp': 'vim', 'do': '~/.vim/plugged/gocode/vim/symlink.sh' }  Plug 'godoctor/godoctor.vim', {'for': 'go'} " Gocode refactoring tool " } 

That is the line I had to change then run :PlugUpdate! and the new plugin was installed.

I figured all of this out due to this comment by Tommaso Sardelli on Github. Thank you Tommaso.

Sat, 05 Jan 2019 11:09:26 -0600 https://blog.jasonmeridth.com/posts/gocode-vim-plugin-and-go-modules/ https://blog.jasonmeridth.com/posts/gocode-vim-plugin-and-go-modules/ go vim
EOS return entry end def rss_entry rss = RSS::Parser.parse(rss_feed_url_content) rss.items[0] end def rss_feed_url_content rss_header=<<-EOS Learn, Converse, Share My Personal Blog https://blog.jasonmeridth.com/ Fri, 01 Mar 2019 13:02:56 -0600 Fri, 01 Mar 2019 13:02:56 -0600 Jekyll v3.7.4 EOS return "#{rss_header}#{rss_feed_entry}" end