~tomleb/repo-url.nvim

3f18888ec75147e580c4e83dc3d21d8df49525c7 — Tom Lebreux 6 months ago 731f7ae
Fix basic gomod
1 files changed, 7 insertions(+), 0 deletions(-)

M lua/repo-url/init.lua
M lua/repo-url/init.lua => lua/repo-url/init.lua +7 -0
@@ 474,6 474,13 @@ local get_gomod_repo_and_version = function()

  -- Matches
  -- 	github.com/kardianos/service => github.com/netbirdio/service v0.0.0-20230215170314-b923b89432b0
  match, _, repo, version = string.find(line, '^	[^ ]+ => ([^ ]+) ([^ ]+)')
  if match then
    return repo, version
  end

  -- Matches
  -- 	github.com/kardianos/service v1.1.1 => github.com/netbirdio/service v0.0.0-20230215170314-b923b89432b0
  match, _, repo, version = string.find(line, '^	[^ ]+ [^ ]+ => ([^ ]+) ([^ ]+)')
  if match then
    return repo, version