Last active
May 4, 2023 03:19
-
-
Save reetasingh/9a989b9229e959e8f1d553fff11df867 to your computer and use it in GitHub Desktop.
save function throwing error in one case and not throwing error in another case
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
type mockTestDB1 struct {} | |
type mockTestDB2 struct {} | |
func (m *mockTestDB1) Save(person *Person) error { | |
// case 1 | |
return nil | |
} | |
func (m *mockTestDB2) Save(person *Person) error { | |
// case 2 | |
return fmt.Errorf("error in save") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment