Created
December 11, 2018 00:39
-
-
Save parzibyte/fff0253e36265a0f8bbffb0585ca7b2c to your computer and use it in GitHub Desktop.
This file contains 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 eliminar(c Contacto) error { | |
db, err := obtenerBaseDeDatos() | |
if err != nil { | |
return err | |
} | |
defer db.Close() | |
sentenciaPreparada, err := db.Prepare("DELETE FROM agenda WHERE id = ?") | |
if err != nil { | |
return err | |
} | |
defer sentenciaPreparada.Close() | |
_, err = sentenciaPreparada.Exec(c.Id) | |
if err != nil { | |
return err | |
} | |
return nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment