import ( "github.com/jinzhu/gorm" _ "github.com/jinzhu/gorm/dialects/mysql" ) type User struct { gorm.Model Name string Age int } func main() { db, err := gorm.Open("mysql", "user:password@tcp(localhost:3306)/my_db") if err != nil { panic("failed to connect database") } defer db.Close() // Delete a single record by ID db.Delete(&User{ID: 1}) // Delete a record by a condition db.Where("age = ?", 18).Delete(&User{}) // Delete multiple records by a condition db.Where("age < ?", 21).Delete(&User{}) // Delete all records from the table (use with caution) db.Delete(&User{}) }In the example above, we create a struct called "User" that will correspond to a database table. Then, we connect to a database and use the Delete function to delete records based on various conditions. The gorm.DB package library is used in this example to interact with the database in a high-level and intuitive manner. It provides a lot of functionality for working with database records, including querying, updating, and deleting records.