Skip to content

Commit 19d4c26

Browse files
authored
(DOCSP-35705) Fixes broken link, updates numbering to bullets (#271)
1 parent 302d211 commit 19d4c26

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/doc_5_best_practices.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ if test != ""
3333
In the Atlas Go SDK, the `*time.Time` type represents date fields for handling time-related data.
3434
When you compare values based on `time.Time`, either never compare pointers directly or do the following:
3535

36-
1. Avoid using direct comparison operators (e.g., `myStruct.MyDateField == ""`) to check for equality. Comparing pointers directly will check if they refer to the same memory address rather than comparing the actual date values. Since each `time.Time` instance is allocated in different memory locations, direct comparisons might yield unexpected results.
36+
- Avoid using direct comparison operators (e.g., `myStruct.MyDateField == ""`) to check for equality. Comparing pointers directly will check if they refer to the same memory address rather than comparing the actual date values. Since each `time.Time` instance is allocated in different memory locations, direct comparisons might yield unexpected results.
3737

38-
2. Use the `Has` function to check non-nil pointers:
38+
- Use the `Has` function to check non-nil pointers:
3939
The SDK provides a dedicated `HasFieldName` or `GetFieldName` function for each model to check if a `time.Time` pointer is non-nil before accessing its value. Always use this function to ensure that the pointer is valid before you perform any operations.
4040

41-
3. Use `time.Time` methods to compare date values:
41+
- Use `time.Time` methods to compare date values:
4242
When you have confirmed that the `time.Time pointer` is non-nil, you can safely use `time.Time` methods to compare the actual date values. Commonly used methods for comparison include `Before`, `After`, and `Equal`:
4343
```go
4444
if !sdkModel.HasSomeDateField() {
@@ -79,7 +79,7 @@ type Data struct {
7979

8080
The following scenarios use pointers with arrays:
8181

82-
1. Update a request containing an empty array (resetting the field values):
82+
- Update a request containing an empty array (resetting the field values):
8383

8484
If you explicitly set a struct property to an empty array, the SDK will send an empty array request to the Atlas API.
8585

@@ -90,7 +90,7 @@ data := Data{
9090
}
9191
```
9292

93-
2. Update a request without updating the array field:
93+
- Update a request without updating the array field:
9494

9595
When performing an update operation, we recommend that you don't set the struct property.
9696

@@ -113,7 +113,7 @@ In the Atlas Go SDK, the `io.ReadCloser` type is used to return binary data usin
113113

114114
- Call the `.Close()` function after reading the data
115115

116-
Note: see example in [examples/download/downloadLogs.go](../examples/download/downloadLogs.go)
116+
Note: see example in [examples/download/downloadLogs.go](https://github.com/mongodb/atlas-sdk-go/blob/main/examples/download/downloadLogs.go)
117117

118118
## Use Method for Creating Models
119119

0 commit comments

Comments
 (0)