Skip to content

Commit 18258e5

Browse files
committed
GODRIVER-94 Change readpref.Primary() to return constant
Change-Id: I8ab5cd88083a981f43890b0c38977889005e923c
1 parent 4729432 commit 18258e5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mongo/readpref/readpref.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ var (
1717
errInvalidReadPreference = errors.New("can not specify tags or max staleness on primary")
1818
)
1919

20+
var primary = ReadPref{mode: PrimaryMode}
21+
2022
// Primary constructs a read preference with a PrimaryMode.
2123
func Primary() *ReadPref {
22-
return &ReadPref{mode: PrimaryMode}
24+
return &primary
2325
}
2426

2527
// PrimaryPreferred constructs a read preference with a PrimaryPreferredMode.

0 commit comments

Comments
 (0)