MCPcopy
hub / github.com/nats-io/nats.go / processUrlString

Function processUrlString

nats.go:1784–1795  ·  view source on GitHub ↗

Process the url string argument to Connect. Return an array of urls, even if only one.

(url string)

Source from the content-addressed store, hash-verified

1782// Process the url string argument to Connect.
1783// Return an array of urls, even if only one.
1784func processUrlString(url string) []string {
1785 urls := strings.Split(url, ",")
1786 var j int
1787 for _, s := range urls {
1788 u := strings.TrimSuffix(strings.TrimSpace(s), "/")
1789 if len(u) > 0 {
1790 urls[j] = u
1791 j++
1792 }
1793 }
1794 return urls[:j]
1795}
1796
1797// Connect will attempt to connect to a NATS server with multiple options.
1798func (o Options) Connect() (*Conn, error) {

Callers 2

TestUrlArgumentFunction · 0.85
ConnectFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestUrlArgumentFunction · 0.68