[GODRIVER-1034] Remove code duplication from description.NewServer and IsMaster.Result Created: 09/May/19  Updated: 28/Oct/23  Resolved: 11/May/20

Status: Closed
Project: Go Driver
Component/s: Core API
Affects Version/s: None
Fix Version/s: 1.4.0

Type: Improvement Priority: Major - P3
Reporter: Kristofer Brandow (Inactive) Assignee: Isabella Siu (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The description.NewServer function currently takes a result.IsMaster, but that adds an extra step of decoding indirection. Instead, take the code from operation.Result and use it to update the description.NewServer method.

The description.NewServer function is only being used in the SDAM spec tests and operation.IsMaster.Result duplicates the code to create a new server description. We should change this so IsMaster.Result uses this function and remove the duplication.

 



 Comments   
Comment by Isabella Siu (Inactive) [ 11/May/20 ]

fixed in: https://github.com/mongodb/mongo-go-driver/commit/a50f838877ed84bcb1f671b0f5d9004c38298dad

Generated at Thu Feb 08 08:35:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.