Skip to content

Commit

Permalink
fix: prepared statement should be closed explicitly
Browse files Browse the repository at this point in the history
Signed-off-by: ms2008 <[email protected]>
  • Loading branch information
ms2008 authored and xcaspar committed Dec 1, 2021
1 parent f0e80b7 commit 0a004a4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions data/experiment.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ func (s *Source) QueryExperimentModelByUid(uid string) (*ExperimentModel, error)
if err != nil {
return nil, err
}
defer stmt.Close()
rows, err := stmt.Query(uid)
if err != nil {
return nil, err
Expand Down Expand Up @@ -303,6 +304,7 @@ func (s *Source) DeleteExperimentModelByUid(uid string) error {
if err != nil {
return err
}
defer stmt.Close()
_, err = stmt.Exec(uid)
if err != nil {
return err
Expand Down

0 comments on commit 0a004a4

Please sign in to comment.