-
Type: Improvement
-
Resolution: Works as Designed
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Go Drivers
Detailed steps to reproduce the problem?
Run the following Go program:
import ( "fmt" "github.com/google/uuid" "go.mongodb.org/mongo-driver/bson" ) func main() { myStruct := struct { MyUUID uuid.UUID `bson:",omitempty"` }{} raw, _ := bson.Marshal(myStruct) fmt.Printf("BSON: %s", string(raw)) }
Note that `myuuid` prints, indicating that Marshal() is creating an empty for the zero-value array.
Definition of done: what must be done to consider the task complete?
The array shouldn’t be marshaled since it’s a zero-value.
The exact Go version used, with patch level:
1.22 (unknown patch level)
The exact version of the Go driver used:
1.15
Describe how MongoDB is set up. Local vs Hosted, version, topology, load balanced, etc.
n/a
The operating system and version (e.g. Windows 7, OSX 10.8, ...)
n/a
Security Vulnerabilities
n/a
- related to
-
GODRIVER-3224 Allow Zeroer to apply to more than just structs
- Backlog