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

cmd/go: Internal package can be imported from outside of the package. #11331

Closed
tobi-c opened this issue Jun 22, 2015 · 1 comment
Closed

cmd/go: Internal package can be imported from outside of the package. #11331

tobi-c opened this issue Jun 22, 2015 · 1 comment
Milestone

Comments

@tobi-c
Copy link

tobi-c commented Jun 22, 2015

go version devel +1be335b Mon Jun 22 11:11:37 2015 +0000 windows/386

package pkg1 // in $GOPATH/pkg1 directory

import _ "image/internal/imageutil"
import _ "image/jpeg"

go build pkg1 command do not occur internal package error.
But if comment out imporot _ "image/jpeg", then occur error.

package pkg1
        imports image/internal/imageutil: use of internal package not allowed

Perhaps, the reason is that there is import "image/internal/imageutil" in jpeg/reader.go file,
and this code.

https://github.com/golang/go/blob/master/src/cmd/go/pkg.go#L867-L869

        for _, dep := range p1.deps {
            deps[dep.ImportPath] = dep
        }

deps["image/internal/imageutil"] is updated to data without error by import _ "image/jpeg".

@mikioh mikioh changed the title Internal package can be imported from outside of the package. cmd/go: Internal package can be imported from outside of the package. Jun 23, 2015
@ianlancetaylor ianlancetaylor added this to the Go1.5Maybe milestone Jul 11, 2015
@gopherbot
Copy link

CL https://golang.org/cl/12450 mentions this issue.

@rsc rsc closed this as completed in d709434 Jul 22, 2015
@mikioh mikioh modified the milestones: Go1.5, Go1.5Maybe Jul 23, 2015
@golang golang locked and limited conversation to collaborators Aug 5, 2016
@rsc rsc removed their assignment Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants