Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/nats-io/nats.go
/ ExampleConn_Publish
Function
ExampleConn_Publish
example_test.go:141–146 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
139
}
140
141
func
ExampleConn_Publish() {
142
nc, _ := nats.Connect(nats.DefaultURL)
143
defer
nc.Close()
144
145
nc.Publish(
"foo"
, []byte(
"Hello World!"
))
146
}
147
148
func
ExampleConn_PublishMsg() {
149
nc, _ := nats.Connect(nats.DefaultURL)
Callers
nothing calls this directly
Calls
3
Connect
Method · 0.80
Publish
Method · 0.65
Close
Method · 0.45
Tested by
no test coverage detected