Skip to content

Conversation

@lifehou5e
Copy link
Contributor

No description provided.

func TestUserHandler_DeleteUser(t *testing.T) {
logger, err := lgr.New("INFO")
if err != nil {
t.FailNow()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you are loosing the err and will have no chance to investigate what happened.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using t.Logf() now, is this the right way?

Copy link
Contributor

@Rusli4k Rusli4k Nov 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you are loosing the err and will have no chance to investigate what happened.

Victor used this as example in video lection. You say its not good idea. Who's right?
But then Volodymyr said all code is bullshit )

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to software development!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chance to get an error there is too little.
Anyway, if you want to cover that - log that error. That's it.

@Anton-Hudz Anton-Hudz requested review from Anton-Hudz and removed request for Anton-Hudz November 16, 2022 14:26
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants