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

Redeclared error after run ginkgo bootstrap with -nodot option #557

Closed
wingyplus opened this issue Jan 23, 2019 · 0 comments · Fixed by #558
Closed

Redeclared error after run ginkgo bootstrap with -nodot option #557

wingyplus opened this issue Jan 23, 2019 · 0 comments · Fixed by #558

Comments

@wingyplus
Copy link
Contributor

wingyplus commented Jan 23, 2019

After run ginkgo with ginkgo boostrap -nodep. It cannot run due to compile error. Reproduce issue steps below:

$ go get -v -u github.com/onsi/ginkgo/...
github.com/onsi/ginkgo (download)
github.com/hpcloud/tail (download)
$ mkdir newsys # this folder create under my $GOPATH/src/github.com/wingyplus
$ cd newsys/
$ ginkgo bootstrap -nodot
Generating ginkgo test suite bootstrap for newsys in:
        newsys_suite_test.go
To update the nodot declarations in the future, switch to this directory and run:
        ginkgo nodot
$ ginkgo
Failed to compile newsys:

# git.domain/repo/newsys_test [git.domain/repo/newsys.test]
./newsys_suite_test.go:82:5: Expect redeclared in this block
        previous declaration at ./newsys_suite_test.go:70:5
./newsys_suite_test.go:83:5: Eventually redeclared in this block
        previous declaration at ./newsys_suite_test.go:72:5
./newsys_suite_test.go:84:5: Consistently redeclared in this block
        previous declaration at ./newsys_suite_test.go:74:5

Ginkgo ran 1 suite in 1.325145506s
Test Suite Failed

After I found this error, I grep Expect to see when it redeclared:

$ grep -r 'Expect' . --color
./newsys_suite_test.go:var Expect = gomega.Expect
./newsys_suite_test.go:var ExpectWithOffset = gomega.ExpectWithOffset
./newsys_suite_test.go:var Expect = gomega.Expect
wingyplus added a commit to wingyplus/ginkgo that referenced this issue Jan 23, 2019
Previously, ginkgo bootstrap -nodot will make compile error because
it export function including method. Fix it by ignore FuncDecl if
Recv is not nil.

Fixes onsi#557
@blgm blgm closed this as completed in #558 Aug 6, 2020
blgm pushed a commit that referenced this issue Aug 6, 2020
Previously, ginkgo bootstrap -nodot will make compile error because
it export function including method. Fix it by ignore FuncDecl if
Recv is not nil.

Fixes #557
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 a pull request may close this issue.

1 participant