Skip to content

Commit

Permalink
docs: Update readme for importing
Browse files Browse the repository at this point in the history
  • Loading branch information
1eedaegon committed Sep 24, 2023
1 parent cc851ae commit 39f654b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,25 @@ A Go library for allocate ports, dynamically.
## Example

```go
import (
...
port "github.com/1eedaegon/go-dynamic-port-allocator"
...
)

ports := port.Get(3)
// ports is something like []int{10000, 10001, 10002}
```

Or

```go
import (
...
port "github.com/1eedaegon/go-dynamic-port-allocator"
...
)

ports := port.GetS(3)
// ports is something like []string{"10000", "10001", "10002"}
```
Expand Down

0 comments on commit 39f654b

Please sign in to comment.