Created
July 10, 2024 00:21
-
-
Save BK1031/ece4a2b11fc3a85e409de755caaa3f24 to your computer and use it in GitHub Desktop.
racecar_analytics create ecu/battery functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func CreateECU(ecu ECU) (ECU, error) { | |
result := DB.Create(&ecu) | |
if result.Error != nil { | |
return ECU{}, result.Error | |
} | |
return ecu, nil | |
} | |
func CreateBattery(battery Battery) (Battery, error) { | |
result := DB.Create(&battery) | |
if result.Error != nil { | |
return Battery{}, result.Error | |
} | |
return battery, nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment