DEV Community

Prasanna Kumar
Prasanna Kumar

Posted on

2 1

go-portfinder: Go implementation of npm portfinder

Go implementation of npm portfinder. A simple tool to find an open port on the current machine.

Installation

$ go get github.com/pgollangi/go-portfinder
Enter fullscreen mode Exit fullscreen mode

Usage

package main

import (
    "github.com/pgollangi/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
     })
}
Enter fullscreen mode Exit fullscreen mode

Repo: https://github.com/pgollangi/go-portfinder

Top comments (0)

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay