]> Cypherpunks repositories - gostls13.git/commit
cmd/go: allow 'go generate' even if imports do not resolve
authorRuss Cox <rsc@golang.org>
Fri, 21 Oct 2016 15:37:54 +0000 (11:37 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 24 Oct 2016 15:17:32 +0000 (15:17 +0000)
commitf3b4abd806c392ff0bf8566009e750ebc01ae355
treed19db6af38dfb27f73bb982a49bedb2096b66fca
parent9575882461b79c833d206ace186db178e5aff9fa
cmd/go: allow 'go generate' even if imports do not resolve

Maybe the go generate is generating the imports,
or maybe there's some other good reason the code
is incomplete.

The help text already says:

Note that go generate does not parse the file, so lines that look
like directives in comments or multiline strings will be treated
as directives.

We'll still reject Go source files that don't begin with a package statement
or have a syntax error in the import block, but those are I think more
defensible rejections.

Fixes #16307.

Change-Id: I4f8496c02fdff993f038adfed2df4db7f067dc06
Reviewed-on: https://go-review.googlesource.com/31659
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
src/cmd/go/generate.go
src/cmd/go/go_test.go
src/cmd/go/pkg.go
src/cmd/go/testdata/src/gencycle/gencycle.go [new file with mode: 0644]