diff --git a/bson/decoder_test.go b/bson/decoder_test.go index 4cebea9d0e..7b91590666 100644 --- a/bson/decoder_test.go +++ b/bson/decoder_test.go @@ -647,7 +647,8 @@ func TestDecoderConfiguration(t *testing.T) { var got objectIDTest err := dec.Decode(&got) - assert.EqualError(t, err, "error decoding key id: decoding an object ID to a non-hexadecimal string representation is not supported") + const want = "error decoding key id: decoding an object ID into a plain string is not supported (set Decoder.ObjectIDAsHexString to enable decoding as a hexadecimal representation)" + assert.EqualError(t, err, want) }) t.Run("DefaultDocumentM top-level", func(t *testing.T) { t.Parallel()