Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mportizlunyov/go-unix-pkg-detector
A go package that reports the package managers installed on a UNIX system.
https://github.com/mportizlunyov/go-unix-pkg-detector
foss go golang unix
Last synced: about 1 month ago
JSON representation
A go package that reports the package managers installed on a UNIX system.
- Host: GitHub
- URL: https://github.com/mportizlunyov/go-unix-pkg-detector
- Owner: mportizlunyov
- License: gpl-3.0
- Created: 2024-11-19T02:26:21.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-12-08T03:35:05.000Z (about 1 month ago)
- Last Synced: 2024-12-08T04:20:41.482Z (about 1 month ago)
- Topics: foss, go, golang, unix
- Language: Go
- Homepage: https://pkg.go.dev/github.com/mportizlunyov/go-unix-pkg-detector/unixpkgdetector
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# UNIX Package Manager Detector (Go edition)
This Go library is a simple tool to detect and return all package managers installed on a system.To use it in your project, run the following command: `go get github.com/mportizlunyov/go-unix-pkg-detector`
Then, import `github.com/mportizlunyov/go-unix-pkg-detector` in your Go program.
See the following methods below.### `Report() ([]string, []string)`
Returns 2 []string arrays containing:
1. Official, distribution package managers
2. Alternative package managers### `Version() (string)`
Returns the full version, including version name, of this library### Example:
Code:
```
package mainimport (
"fmt"// Imported library
"github.com/mportizlunyov/go-unix-pkg-detector/unixpkgdetector"
)func main() {
fmt.Println("Hello!")
// Report() method
fmt.Println(unixpkgdetector.Report())
// Version() method
fmt.Println(unixpkgdetector.Version())
}
```
Result on a typical default Ubuntu systems:
```
Hello!
[apt] [snap]
v1.0.4-release ( November 24th, 2024)
```