MCPcopy
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
141func ExampleConn_Publish() {
142 nc, _ := nats.Connect(nats.DefaultURL)
143 defer nc.Close()
144
145 nc.Publish("foo", []byte("Hello World!"))
146}
147
148func ExampleConn_PublishMsg() {
149 nc, _ := nats.Connect(nats.DefaultURL)

Callers

nothing calls this directly

Calls 3

ConnectMethod · 0.80
PublishMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected