goplspd

command module
v0.0.0-...-611514d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2025 License: Unlicense Imports: 9 Imported by: 0

README

spd – Simple Package Driver

What

spd implements custom GOPACKAGESDRIVER for gopls. Unlike go list, spd scans only given directories via SPDTARGETS variable allowing to run gopls in large repos.

Editor support

VSCode

Be aware to run VSCode from the root directory.

{
  "gopls": {
    "build.directoryFilters": [
        "-",
        "+prj1",
        "+prj2",
        "+prj3",
    ],
    "build.env": {
        "GOPACKAGESDRIVER": "path to spd",
        "SPDTARGETS": "prj1,prj2,prj3",
        "GOFLAGS": "-mod=vendor", // may apply
    }
  }
}
Neovim
local lspconfig = require("lspconfig")

local targets = {
    "prj1",
    "prj2",
    "prj3",
}

local gopls_config = {
    settings = {
        gopls = {
            env = {
                "GOPACKAGESDRIVER" = "path to spd",
                "SPDTARGETS" = table.concat(targets, ","),
                "GOFLAGS" = "-mod=vendor", -- may apply
            },
        },
    }
}

gopls_config.settings.gopls.directoryFilters = {
    "-"
}

for _, target in ipairs(targets) do
    table.insert(gopls_config.settings.gopls.directoryFilters, "+"..target)
end

lspconfig.gopls.setup(gopls_config)

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL