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: go get fails for nested repo when there are no go files in the root directory #66328

Closed
Noofbiz opened this issue Mar 15, 2024 · 2 comments

Comments

@Noofbiz
Copy link

Noofbiz commented Mar 15, 2024

Go version

go1.22.1 linux/am64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/noofbiz/.cache/go-build'
GOENV='/home/noofbiz/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/noofbiz/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/noofbiz/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/lib/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/lib/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.22.1'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/home/noofbiz/git/CardReader/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1358558468=/tmp/go-build -gno-record-gcc-switches'

What did you do?

I have a library github.com/Noofbiz/go-card/smartcard that is in a repo with no go files in the root (go-card). When I try to import/add this library to another project with go get github.com/Noofbiz/go-card/smartcard it fails to build with an error. I've tried other fixes, such as running `go clean --modcache' but it doesn't help.

What did you see happen?

My results from go get:

$ go get -v github.com/Noofbiz/go-card/smartcard
go: downloading github.com/Noofbiz/go-card v0.0.0-20240314193412-f61d4e0f5cc5
go: module github.com/Noofbiz/go-card@upgrade found (v0.0.0-20240314193412-f61d4e0f5cc5), but does not contain package github.com/Noofbiz/go-card/smartcard

What did you expect to see?

The module to be added and usable.

@seankhliao seankhliao changed the title cmd/get go get fails for nested repo when there are no go files in the root directory cmd/go: go get fails for nested repo when there are no go files in the root directory Mar 15, 2024
@seankhliao
Copy link
Member

Doesn't seem to be reproducible. In any case, I see it used @upgrade when you should probably use @latest.

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Mar 15, 2024
@Noofbiz
Copy link
Author

Noofbiz commented Mar 15, 2024

using go run and letting it automatically add the dependencies worked just fine! Sorry for any inconvenience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants