title: Update method does not update zero value
body: <p><strong>Original Question</strong></p>
  <p>When using the <code>Update</code> method in GORM the new data does not get saved. i.e. I want to set a <code>bool</code> from <code>true</code> to <code>false</code>, but it stays true even after the <code>Update</code> method.</p>
  <p>In the description of the method there is a warning: &quot;WARNING when update with struct, GORM will not update fields that with zero value&quot;</p>
  <p>Since I am using a struct to update and <code>false</code> is the zero value of <code>bool</code>, this seems expected behaviour, but I don't see any reason why to do so and how to overcome this.</p>
  <pre><code>func UpdateData(c *fiber.Ctx) error {
      db := database.DBConn
  
      data := new([]entities.Data)
  
      if err := c.BodyParser(&amp;data); err != nil {
          return err
      }
  
      db.Update(&amp;data)
      return c.JSON(data)
  }
  </code></pre>
  <p><strong>Solution Summary</strong></p>
  <p>First, as suggested I left out the <code>new</code> keyword when instantiating the structs. Then, I used a helper function (from <a href="https://stackoverflow.com/a/59756527/11465355">here</a>) for converting a struct to map while keeping the json alias as keys:</p>
  <pre><code>// StructToMap Converts a struct to a map while maintaining the json alias as keys
  func StructToMap(obj interface{}) (newMap map[string]interface{}, err error) {
      data, err := json.Marshal(obj)
  
      if err != nil {
          return
      }
  
      err = json.Unmarshal(data, &amp;newMap) // Convert to a map
      return
  }
  </code></pre>
  <p>Then I loop over each element in the data slice in order to convert it and update it one by one:</p>
  <pre><code>func UpdateData(c *fiber.Ctx) error {
      db := database.DBConn
  
      data := []entities.Dard{}
  
      if err := c.BodyParser(&amp;data); err != nil {
          return err
      }
  
      for _, record := range data {
          mappedData, _ := StructToMap(record)
          db.Model(&amp;entities.Data{}).Update(mappedData)
      }
  
      return c.JSON(data)
  }
  </code></pre>
  <p>*Error handling is obviously reduced in this example.</p>