Skip to content

Commit c0711bf

Browse files
author
Isabella Siu
committed
GODRIVER-348 remove NewClientFromConnString
Change-Id: I6493a4be9d54e5f8f57d05527d2b150ba408c532
1 parent a02aaea commit c0711bf

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

benchmark/single.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func getClientDB(ctx context.Context) (*mongo.Database, error) {
2727
if err != nil {
2828
return nil, err
2929
}
30-
client, err := mongo.NewClientFromConnString(cs)
30+
client, err := mongo.NewClient(cs.String())
3131
if err != nil {
3232
return nil, err
3333
}

mongo/client.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,6 @@ func NewClientWithOptions(uri string, opts ...*options.ClientOptions) (*Client,
7979
return newClient(cs, opts...)
8080
}
8181

82-
// NewClientFromConnString creates a new client to connect to a cluster, with configuration
83-
// specified by the connection string.
84-
func NewClientFromConnString(cs connstring.ConnString) (*Client, error) {
85-
return newClient(cs)
86-
}
87-
8882
// Connect initializes the Client by starting background monitoring goroutines.
8983
// This method must be called before a Client can be used.
9084
func (c *Client) Connect(ctx context.Context) error {

mongo/gridfs/gridfs_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ func clearCollections(t *testing.T) {
160160

161161
func TestGridFSSpec(t *testing.T) {
162162
var err error
163-
client, err = mongo.NewClientFromConnString(testutil.ConnString(t))
163+
cs := testutil.ConnString(t)
164+
client, err = mongo.NewClient(cs.String())
164165
testhelpers.RequireNil(t, err, "error creating client: %s", err)
165166

166167
err = client.Connect(ctx)

0 commit comments

Comments
 (0)