This content originally appeared on DEV Community and was authored by Prasanna Kumar
Go implementation of npm portfinder. A simple tool to find an open port on the current machine.
Installation
$ go get github.com/pgollang/go-portfinder
Usage
package main
import (
"github.com/pgollang/go-portfinder"
)
func main(){
// scans and returns first open port on all network interfaces of current machine.
openPort, err := portfinder.GetPort(&PortFinderOptions {
StartPort: 9090,
StopPort: 9099
})
}
Repo: https://github.com/pgollangi/go-portfinder
This content originally appeared on DEV Community and was authored by Prasanna Kumar
Prasanna Kumar | Sciencx (2021-04-14T13:15:53+00:00) go-portfinder: Go implementation of npm portfinder. Retrieved from https://www.scien.cx/2021/04/14/go-portfinder-go-implementation-of-npm-portfinder/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.