Last active
May 18, 2021 14:12
-
-
Save utkarshmani1997/941600a7dc4999619afd0729ac32697a 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
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