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

Remove the unused valiable #1548

Merged

Conversation

ikawaha
Copy link
Contributor

@ikawaha ikawaha commented Feb 19, 2018

Go version 1.10, go vet command strictly detects not used variables in tests as follows:

$ go vet ./app/test/
# cellar/app/test
app/test/bottle_testing.go:36:3: resp declared but not used
func ShowBottleNotFound(t goatest.TInterface, ctx context.Context, service *goa.Service, ctrl app.BottleController, bottleID interface{}) http.ResponseWriter {
        // Setup service
        var (
                logBuf bytes.Buffer
                resp   interface{} // ← ★

                respSetter goatest.ResponseSetterFunc = func(r interface{}) { resp = r }

This patch fix it to generate it only when the resp is used.

@raphael
Copy link
Member

raphael commented Feb 19, 2018

Great! thank you.

@raphael raphael merged commit ee73744 into goadesign:master Feb 19, 2018
@raphael
Copy link
Member

raphael commented Feb 19, 2018

Can you please port that fix to the v1 branch as well? Thank you!

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.

2 participants