Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unclosetx: not detect about nested struct having Spanner's client #46

Open
iwata opened this issue Mar 31, 2021 · 0 comments
Open

unclosetx: not detect about nested struct having Spanner's client #46

iwata opened this issue Mar 31, 2021 · 0 comments

Comments

@iwata
Copy link

iwata commented Mar 31, 2021

unclosetx cannot detect looks like this sample code.

func (h *Handler) fetchUser(ctx context.Context, userID string) (*database.User, error) {
	txn := h.repository.Client.ReadOnlyTransaction() // h.repository.Client is a Spanner client.
	
	user, err := database.FindUser(ctx, txn, userID)
	if err != nil {
		return nil, err
	}
	return user, nil
}
@iwata iwata changed the title unclosetx: false positive about nested struct having Spanner's client unclosetx: not detect about nested struct having Spanner's client Apr 1, 2021
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

No branches or pull requests

1 participant