Skip to content

Instantly share code, notes, and snippets.

@BK1031
Last active July 11, 2024 11:27
Show Gist options
  • Save BK1031/280fd611b303289d7edfdf5d72fce3a7 to your computer and use it in GitHub Desktop.
Save BK1031/280fd611b303289d7edfdf5d72fce3a7 to your computer and use it in GitHub Desktop.
racecar_analytics add push to create functions
func CreateECU(ecu ECU) (ECU, error) {
result := DB.Create(&ecu)
if result.Error != nil {
return ECU{}, result.Error
}
PushECU(ecu) // add this
return ecu, nil
}
func CreateBattery(battery Battery) (Battery, error) {
result := DB.Create(&battery)
if result.Error != nil {
return Battery{}, result.Error
}
PushBattery(battery) // add this
return battery, nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment