go run Cmd/compile/, then errors: use of internal package not allowed

158 views
Skip to first unread message

布雷

unread,
Sep 14, 2022, 10:48:19 AM9/14/22
to golang-nuts
    when I run `go run src/cmd/compile/main.go`, I got error at main.go:8:2: use of internal package cmd/compile/internal/amd64 not allowed. I'm confused with the error and cann't solve it.
getting help.

Ian Lance Taylor

unread,
Sep 14, 2022, 10:57:39 AM9/14/22
to 布雷, golang-nuts
On Wed, Sep 14, 2022 at 7:48 AM 布雷 <gong...@gmail.com> wrote:
>
> when I run `go run src/cmd/compile/main.go`, I got error at main.go:8:2: use of internal package cmd/compile/internal/amd64 not allowed. I'm confused with the error and cann't solve it.
> getting help.

I wouldn't expect that to work even if you were able to fix that
problem. What are you really trying to do?

Note that "go run" is a convenience feature, not really suited for a
complex tool like cmd/compile.

Ian

布雷

unread,
Sep 14, 2022, 7:39:23 PM9/14/22
to golang-nuts
截屏2022-09-15 07.31.40.pngye, cmd/compile is golang compiler and complex.  
because I want to read the some code under the cmd/compile directory.
截屏2022-09-15 07.33.25.png
have install `Rich Go language support for Visual Studio Code` and install golang in /usr/local/go and set $GOROOT and $GOPATH in the system path.
work fine with simple golang project.  but not work intelligent with cmd/compile project.... 
`
Reply all
Reply to author
Forward
0 new messages