google / uuid

Go package for UUIDs based on RFC 4122 and DCE 1.1: Authentication and Security Services.
BSD 3-Clause "New" or "Revised" License
5.24k stars 363 forks source link

not able to install uuid package #99

Open helal-abbas opened 2 years ago

helal-abbas commented 2 years ago

RUN go install github.com/google/uuid@v1.3.0 or RUN go install github.com/google/uuid running these command but getting such error, RUN go install github.com/google/uuid@v1.3.0:

10 0.943 go: downloading github.com/google/uuid v1.3.0

10 2.980 package github.com/google/uuid is not a main package


executor failed running [/bin/sh -c go install github.com/google/uuid@v1.3.0]: exit code: 1

please give me some solution for same

yuki2006 commented 2 years ago

This library is not command.

So, You should do go get github.com/google/uuid

The Readme also says so. https://github.com/google/uuid#readme

andymend commented 2 years ago

When I use go get-- I get an error: $go get github.com/google/uuid go: go.mod file not found in current directory or any parent directory. 'go get' is no longer supported outside a module. To build and install a command, use 'go install' with a version, like 'go install example.com/cmd@latest' For more information, see https://golang.org/doc/go-get-install-deprecation or run 'go help get' or 'go help install'.

go version go1.18 linux/amd64 on Ubuntu 2004

helal-abbas commented 2 years ago

Don't use get or install, Just import github/google/uuid in the file, it will work

On Mon, 11 Apr, 2022, 11:26 pm andymend, @.***> wrote:

When I use go get-- I get an error: $go get github.com/google/uuid go: go.mod file not found in current directory or any parent directory. 'go get' is no longer supported outside a module. To build and install a command, use 'go install' with a version, like 'go install @.***' For more information, see https://golang.org/doc/go-get-install-deprecation or run 'go help get' or 'go help install'.

go version go1.18 linux/amd64 on Ubuntu 2004

— Reply to this email directly, view it on GitHub https://github.com/google/uuid/issues/99#issuecomment-1095357076, or unsubscribe https://github.com/notifications/unsubscribe-auth/AISUBWQ3C2VZJPCBBURCKZDVERRURANCNFSM5RUAM7FQ . You are receiving this because you authored the thread.Message ID: @.***>

matt-culbert commented 1 year ago

Don't use get or install, Just import github/google/uuid in the file, it will work

This does not work, the package needs to be installed otherwise it cannot be found and it can't be installed because it is not a main package

gabrielsolanha commented 1 year ago

When I use go get-- I get an error:

$go get github.com/google/uuid go: go.mod file not found in current directory or any parent directory. 'go get' is no longer supported outside a module. To build and install a command, use 'go install' with a version, like 'go install example.com/cmd@latest' For more information, see https://golang.org/doc/go-get-install-deprecation or run 'go help get' or 'go help install'. go version go1.18 linux/amd64 on Ubuntu 2004

I was having the same problem and I discovered that u have to init a module so I run go mod init and go get github.com/google/uuid works good for me (I'm learning so do not judge me please 😂)