Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions ziti/contexts.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"net/http"
"net/url"
"strconv"
"sync/atomic"

"github.com/kataras/go-events"
"github.com/michaelquigley/pfxlog"
Expand All @@ -40,13 +41,13 @@ import (
"github.com/pkg/errors"
)

var idCount = 0
var idCount atomic.Int32

// NewId will return a unique string id suitable for ziti.Context Id functionality.
func NewId() string {
idCount = idCount + 1
new := idCount.Add(1)

return strconv.Itoa(idCount)
return strconv.Itoa(int(new))
}

// NewContextFromFile attempts to load a new Config from the provided path and then uses that
Expand Down