minus-squarem29h@feddit.nltoGo programming language discussion@lemmy.ml•a bson struct tag to create a unique index just like gormlinkfedilinkarrow-up2·1 year agoWhy don’t you just set the id to whatever ( e.g UUID) you want in your struct constructor. Alternatively I guess there are also mongodb specific client libraries for Go linkfedilink
Why don’t you just set the id to whatever ( e.g UUID) you want in your struct constructor. Alternatively I guess there are also mongodb specific client libraries for Go