Skip to content

cmd/go: reject leading dot in module name #66954

Open
@Mgrdich

Description

@Mgrdich

Go version

go1.22.1

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/mgo/Library/Caches/go-build'
GOENV='/Users/mgo/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/mgo/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/mgo/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/Users/mgo/sdk/go1.22.1'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/Users/mgo/sdk/go1.22.1/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.22.1'
GCCGO='gccgo'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/Users/mgo/Documents/testGoApi/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 -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/dn/076kyhqn5knf9lgnb0v9m5980000gn/T/go-build2843189004=/tmp/go-build -gno-record-gcc-switches -fno-common

What did you do?

It is happening when everything is in different folder , and initiated with different packages , that is why i cannot link go.dev/play

but i can link the github repo with a branch that this is happening

https://github.com/Mgrdich/testGoApi/tree/bug/issue/golang

https://github.com/Mgrdich/testGoApi/blob/fd329312a1472c5d3c5269f792a438d999e43829/internal/routes/person.go#L18

https://github.com/Mgrdich/testGoApi/blob/fd329312a1472c5d3c5269f792a438d999e43829/internal/middlewares/movies.go#L28

https://github.com/Mgrdich/testGoApi/blob/fd329312a1472c5d3c5269f792a438d999e43829/internal/middlewares/id_context.go#L14

What did you see happen?

i keep getting this compile time error

panic: R_USEIFACE in .com/internal/middlewares..dict.CheckSlugId[.com/internal/models.Person] references type:.com/internal/util.GetByIDFunc[.com/internal/models.Person] which is not a type or itab

goroutine 1 [running]:
cmd/link/internal/ld.(*deadcodePass).flood(0x14000026910)
	cmd/link/internal/ld/deadcode.go:208 +0xfd4
cmd/link/internal/ld.deadcode(0x1400015e000)
	cmd/link/internal/ld/deadcode.go:433 +0x58
cmd/link/internal/ld.Main(_, {0x10, 0x20, 0x1, 0x1f, 0x1e, 0x7c00000, {0x0, 0x0, 0x0}, ...})
	cmd/link/internal/ld/main.go:353 +0x1180
main.main()
	cmd/link/main.go:72 +0xbd4

as i noticed it is happening something with the folder and package structure

  • i did check for cyclical reference none was there.
  • i am not returning nil references
  • i did raise this issue in golang discord community , they could not figure it out they told me to open an issue.

What did you expect to see?

It return the correct error , with description that module name is invalid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GoCommandcmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.help wanted

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions