String to ObjectId MongoDB Golang

objID, err := primitive.ObjectIDFromHex(hexString)
if err != nil {
  panic(err)
}
mohammad ghari