gopkg is a lightweight dependency manager for Go projects. It provides an alternative to Go modules by managing dependencies through a custom gopkg.toml file, with support for both local and global installations.
- Manage dependencies via
gopkg.toml - Supports local (
./gopkg_modules/) and global (~/.gopkg/modules/) installation - Lockfile support via
gopkg.lock - Auto detection mode (
--auto) to scan Go imports and populategopkg.toml - Adds
replacedirectives togo.modautomatically - CLI commands: install, update, remove, check, list, versions
- Clean command to wipe installed modules, cache, and lockfile
Install using go install:
go install github.com/pageton/gopkg@latestOr build manually:
git clone https://github.com/pageton/gopkg
cd gopkg
go build -o gopkg .gopkg initCreates a gopkg.toml file and gopkg_modules/ directory.
gopkg add github.com/mattn/[email protected]To add it globally, use:
gopkg add -g github.com/mattn/[email protected]gopkg installOr using alias:
gopkg iInstall globally:
gopkg install --globalUse --auto to scan .go files and populate gopkg.toml:
gopkg install --autogopkg updateUpdate a specific module:
gopkg update github.com/mattn/go-sqlite3@latestUpdate globally:
gopkg update -ggopkg remove github.com/mattn/go-sqlite3Remove globally:
gopkg remove -g github.com/mattn/go-sqlite3gopkg versions github.com/mattn/go-sqlite3gopkg checkgopkg clean --lock --cachegopkg
├── cmd
│ ├── add.go
│ ├── check.go
│ ├── clean.go
│ ├── init.go
│ ├── install.go
│ ├── list.go
│ ├── remove.go
│ ├── root.go
│ ├── update.go
│ └── versions.go
├── core
│ ├── extract.go
│ ├── fetcher.go
│ ├── gomod.go
│ ├── importscan.go
│ ├── lockfile.go
│ ├── metadata.go
│ ├── module.go
│ ├── paths.go
│ └── version.go
├── go.mod
├── go.sum
└── main.go
Contributions are welcome. Please open an issue for suggestions or bugs, or submit a pull request directly. Make sure your code is clean and tested where appropriate.
MIT License