It would also be nice to test for failure when "foo/bar" and "foo/internal/quux" are in ...
10 years, 9 months ago
(2014-08-06 03:50:29 UTC)
#5
It would also be nice to test for failure when "foo/bar" and
"foo/internal/quux" are in separate workspaces.
I know this is obviously correct given the code as-is, but this might stop
us from breaking it later.
On 6 August 2014 13:48, <adg@golang.org> wrote:
> No test for the success case?
>
> package "foo/bar" successfully importing "foo/internal/quux"?
>
> https://codereview.appspot.com/120600043/
>
LGTM but i don't like the name checkInternal. https://codereview.appspot.com/120600043/diff/60001/src/cmd/go/pkg.go File src/cmd/go/pkg.go (right): https://codereview.appspot.com/120600043/diff/60001/src/cmd/go/pkg.go#newcode247 src/cmd/go/pkg.go:247: if ...
10 years, 9 months ago
(2014-08-06 14:25:18 UTC)
#6
LGTM but i don't like the name checkInternal.
https://codereview.appspot.com/120600043/diff/60001/src/cmd/go/pkg.go
File src/cmd/go/pkg.go (right):
https://codereview.appspot.com/120600043/diff/60001/src/cmd/go/pkg.go#newcode247
src/cmd/go/pkg.go:247: if perr := checkInternal(srcDir, p, stk); perr != nil {
On 2014/08/06 03:37:59, rsc wrote:
> perr is used. it has the error message inside it.
not sure how i missed the 'return perr'.
ok. i still don't like the name and the structure is weird. why doesn't
loadImport return an error instead of burying it? but i suspect both are
unlikely to change.
The Error being part of the Package simplifies the rest of the program: it allows ...
10 years, 9 months ago
(2014-08-06 20:33:17 UTC)
#7
The Error being part of the Package simplifies the rest of the program: it
allows gathering as many errors as possible during a load and gives a place
to hang the associated context. I changed checkInternal to
disallowInternal, and it either returns p (not nil) or perr. That should be
a little clearer.
The internal rule only applies to $GOROOT for 1.4, something I forgot to
include but that is now there. Given that, it is not possible to test for
success from outside $GOROOT. Brad has provided a test inside $GOROOT
(net/http and net/http/httputil import net/http/internal). I added a test
that internal has no meaning outside $GOROOT.
Russ
Issue 120600043: code review 120600043: cmd/go: implement 'internal' convention
(Closed)
Created 10 years, 9 months ago by rsc
Modified 10 years, 9 months ago
Reviewers: gobot
Base URL:
Comments: 6