Skip to content

Commit

Permalink
Update go mod
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
  • Loading branch information
piotrpio committed Oct 13, 2023
1 parent 981da31 commit 1a13c93
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 54 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ require (
github.com/klauspost/compress v1.17.0
github.com/nats-io/nkeys v0.4.5
github.com/nats-io/nuid v1.0.1
golang.org/x/text v0.13.0
)

require (
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc=
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
16 changes: 0 additions & 16 deletions js_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,10 @@ package nats
////////////////////////////////////////////////////////////////////////////////

import (
"os"
"strings"
"testing"
)

func createConfFile(t *testing.T, content []byte) string {
t.Helper()
conf, err := os.CreateTemp("", "")
if err != nil {
t.Fatalf("Error creating conf file: %v", err)
}
fName := conf.Name()
conf.Close()
if err := os.WriteFile(fName, content, 0666); err != nil {
os.Remove(fName)
t.Fatalf("Error writing conf file: %v", err)
}
return fName
}

func TestJetStreamConvertDirectMsgResponseToMsg(t *testing.T) {
// This test checks the conversion of a "direct get message" response
// to a JS message based on the content of specific NATS headers.
Expand Down
22 changes: 0 additions & 22 deletions nats.go
Original file line number Diff line number Diff line change
Expand Up @@ -3077,28 +3077,6 @@ func (nc *Conn) waitForMsgs(s *Subscription) {
// Return what is to be used. If we return nil the message will be dropped.
type msgFilter func(m *Msg) *Msg

func (nc *Conn) addMsgFilter(subject string, filter msgFilter) {
nc.subsMu.Lock()
defer nc.subsMu.Unlock()

if nc.filters == nil {
nc.filters = make(map[string]msgFilter)
}
nc.filters[subject] = filter
}

func (nc *Conn) removeMsgFilter(subject string) {
nc.subsMu.Lock()
defer nc.subsMu.Unlock()

if nc.filters != nil {
delete(nc.filters, subject)
if len(nc.filters) == 0 {
nc.filters = nil
}
}
}

// processMsg is called by parse and will place the msg on the
// appropriate channel/pending queue for processing. If the channel is full,
// or the pending queue is over the pending limits, the connection is
Expand Down
14 changes: 0 additions & 14 deletions nats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,20 +206,6 @@ func TestExpandPath(t *testing.T) {
}
}

////////////////////////////////////////////////////////////////////////////////
// Reconnect tests
////////////////////////////////////////////////////////////////////////////////

const TEST_PORT = 8368

var reconnectOpts = Options{
Url: fmt.Sprintf("nats://127.0.0.1:%d", TEST_PORT),
AllowReconnect: true,
MaxReconnect: 10,
ReconnectWait: 100 * time.Millisecond,
Timeout: DefaultTimeout,
}

////////////////////////////////////////////////////////////////////////////////
// ServerPool tests
////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 2 additions & 2 deletions test/kv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,7 @@ func TestKeyValueNonDirectGet(t *testing.T) {
nc, js := jsClient(t, s)
defer nc.Close()

kvi, err := js.CreateKeyValue(&nats.KeyValueConfig{Bucket: "TEST"})
_, err := js.CreateKeyValue(&nats.KeyValueConfig{Bucket: "TEST"})
if err != nil {
t.Fatalf("Error creating store: %v", err)
}
Expand All @@ -1171,7 +1171,7 @@ func TestKeyValueNonDirectGet(t *testing.T) {
if _, err := js.UpdateStream(&cfg); err != nil {
t.Fatalf("Error updating stream: %v", err)
}
kvi, err = js.KeyValue("TEST")
kvi, err := js.KeyValue("TEST")
if err != nil {
t.Fatalf("Error getting kv: %v", err)
}
Expand Down

0 comments on commit 1a13c93

Please sign in to comment.