etkecc / emm

GNU Affero General Public License v3.0
3 stars 1 forks source link

`go install` fails with "module ... found but does not contain package ..." #1

Closed rehandaphedar closed 2 months ago

rehandaphedar commented 2 months ago

Hi, great project, especially useful as a psuedo CMS for Hugo!

On Arch Linux, with go version go1.23.0 linux/amd64, running go install github.com/etkecc/emm@latest fails with:

go: github.com/etkecc/emm@latest: module github.com/etkecc/emm@latest found (v0.9.8), but does not contain package github.com/etkecc/emm

I thought the golang proxy cache might have gotten stale, so I tried with GOPROXY=direct, still fails.

Manually building after cloning the repository works. For now, I'm using the AUR package, which also works.

go.mod does contain module github.com/etkecc/emm. However, there is no main.go file in the root directory, which I suspect is the cause.

Running go install github.com/etkecc/emm/cmd@latest works, but it installs the binary as cmd, not as emm.

Also, I see that cmd/main.go contains package main instead of package cmd.

The solution seems to be to move/rename cmd/main.go to main.go, as per the golang documentation.

rehandaphedar commented 2 months ago

Oh great speed! I was just about to make a PR for this.

aine-etke commented 2 months ago

Thank you for bringing this to our attention! The fix is available in the latest release