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

Function NewJsonEncodedConn

test/json_test.go:27–33  ·  view source on GitHub ↗

lint:file-ignore SA1019 Ignore deprecation warnings for EncodedConn

(tl TestLogger)

Source from the content-addressed store, hash-verified

25//lint:file-ignore SA1019 Ignore deprecation warnings for EncodedConn
26
27func NewJsonEncodedConn(tl TestLogger) *nats.EncodedConn {
28 ec, err := nats.NewEncodedConn(NewConnection(tl, TEST_PORT), nats.JSON_ENCODER)
29 if err != nil {
30 tl.Fatalf("Failed to create an encoded connection: %v\n", err)
31 }
32 return ec
33}
34
35func TestEncBuiltinJsonMarshalString(t *testing.T) {
36 s := RunServerOnPort(TEST_PORT)

Calls 2

FatalfMethod · 0.80
NewConnectionFunction · 0.70

Tested by

no test coverage detected