Skip to content

Commit 03fda7a

Browse files
Rename ErrorCodesFrom to ErrorCodes to match error interface function
1 parent 58198cf commit 03fda7a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mongo/errors.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -904,8 +904,8 @@ func joinBatchErrors(errs []error) string {
904904
return buf.String()
905905
}
906906

907-
// ErrorCodesFrom returns the list of server error codes contained in err.
908-
func ErrorCodesFrom(err error) []int {
907+
// ErrorCodes returns the list of server error codes contained in err.
908+
func ErrorCodes(err error) []int {
909909
if err == nil {
910910
return nil
911911
}

mongo/errors_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ func TestErrorCodesFrom(t *testing.T) {
832832

833833
for _, tt := range tests {
834834
t.Run(tt.name, func(t *testing.T) {
835-
require.Equal(t, tt.want, ErrorCodesFrom(tt.input))
835+
require.Equal(t, tt.want, ErrorCodes(tt.input))
836836
})
837837
}
838838
}

0 commit comments

Comments
 (0)