Skip to content

Latest commit

 

History

History
30 lines (23 loc) · 501 Bytes

README.md

File metadata and controls

30 lines (23 loc) · 501 Bytes

gort

Free Port finder using Golang

Import as package

    package main
    
    import (
        "fmt"
        "github.com/gort"
    )
    
    func main(){
        tcpPort, err := gort.GetFreePort()
        if err != nil{
            fmt.Println(fmt.Sprintf("Fatal error: %s", err.Error()))
        }
        fmt.Println(tcpPort)
    }

As an Executable

Once the gort is built using go build , use the executable as

    $ gort
    $ SOME_PORT_NUMBER_PRINTED