I can not go get golang.org

Hello there! o/

I just started Go few hours ago. So far I’m already stuck when trying to install the go dependency golang.org/x/image/color and I did not find a clue online. Here is what I did:

> rm -rf /home/nathanael/.cache/gopath/src/golang.org/x/image/
> go get golang.org/x/image/color
package golang.org/x/image/color: cannot find package "golang.org/x/image/color" in any of:
        /usr/lib/go-1.13/src/golang.org/x/image/color (from $GOROOT)
        /home/nathanael/.cache/gopath/src/golang.org/x/image/color (from $GOPATH)
> go get golang.org/x/image
cant load package: package golang.org/x/image: no Go files in /home/nathanael/.cache/gopath/src/golang.org/x/image
> ls /home/nathanael/.cache/gopath/src/golang.org/x/image/
AUTHORS  ccitt  codereview.cfg  CONTRIBUTING.md  draw     font    go.sum   math     README.md  testdata  vector  vp8l
bmp      cmd    colornames      CONTRIBUTORS     example  go.mod  LICENSE  PATENTS  riff       tiff      vp8     webp

So:

  • why go get golang.org/x/image/color complains about not finding the “golang.org/x/image/color” package?
  • what is this error cant load package: package golang.org/x/image: no Go files, while the folder has been downloaded?

By the way I can go get other packages, for instances go get golang.org/x/image/colornames works.

Any help? :slight_smile:
Thank you

1 Like

Got it!

In fact I wanted the builtin image/color package, and not golang.org/x/image/color, witch does not exist.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.