Skip to content

Instantly share code, notes, and snippets.

@utkarshmani1997
Last active May 18, 2021 14:12
Show Gist options
  • Save utkarshmani1997/941600a7dc4999619afd0729ac32697a to your computer and use it in GitHub Desktop.
Save utkarshmani1997/941600a7dc4999619afd0729ac32697a to your computer and use it in GitHub Desktop.
package main
import "github.com/utkarshmani1997/talks/12Dec2020/techniques/mocking/sample_app/database"
func main() {
database.Setup()
user := database.NewUser(23, "gmail.com", "Utkarsh", "Mani Tripathi")
insertUser(user)
database.TearDown()
}
func insertUser(user database.Users) (int, error) {
id, err := user.Insert()
if err != nil {
return 0, err
}
if id == 5 {
fmt.Println("Id is 5")
}
return id, nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment