drivers icon indicating copy to clipboard operation
drivers copied to clipboard

go.mod weirdness or my stupidity?

Open gherlein opened this issue 1 year ago • 8 comments

If I have a go.mod with:

module tinygo.org/x/drivers

I get this error:

gherlein@io:~/src/tinygo/m$ go mod tidy
go: finding module for package tinygo.org/x/drivers/mcp2515
go: tinygo.org/x/drivers imports
	tinygo.org/x/drivers/mcp2515: cannot find module providing package tinygo.org/x/drivers/mcp2515: unrecognized import path "tinygo.org/x/drivers/mcp2515": reading https://tinygo.org/x/drivers/mcp2515?go-get=1: 404 Not Found

If I change the go.mod to

module tinygo.org/drivers

it works.

I'm too new to go.mod foo to really grok this but it does not seem right.

gherlein avatar Aug 13 '24 21:08 gherlein

It looks like the redirect is missing here: https://github.com/tinygo-org/tinygo-site/tree/dev/static/x/drivers

A workaround is indeed to use the module tinygo.org/x/drivers, but to avoid this issue in the future a small file needs to be added to tinygo-site to add the right redirect.

aykevl avatar Aug 14 '24 12:08 aykevl

See https://github.com/tinygo-org/tinygo-site/pull/419 for PR that adds the missing files.

deadprogram avatar Aug 14 '24 15:08 deadprogram

so fast! Great. How do I learn more about the module index stuff? It seems that tinygo.org/x/drivers/mcp2515 is somehow pointing to https://tinygo.org/x/drivers/mcp2515?go-get=1 - which you fixed the redirect. But how do I get smarter on where the index lives that does that mapping? If you know I'd love a pointer so I get smarter.

thanks again for the very fast fix.

gherlein avatar Aug 14 '24 16:08 gherlein

See https://pkg.go.dev/cmd/go#hdr-Remote_import_paths for more info

deadprogram avatar Aug 14 '24 16:08 deadprogram

Thanks!

gherlein avatar Aug 14 '24 17:08 gherlein

See tinygo-org/tinygo-site#419 for PR that adds the missing files.

If I get a wild hair and want to propose some documentation updates, are you guys open to PRs for the web site?

gherlein avatar Aug 14 '24 17:08 gherlein

Absolutely yes!

deadprogram avatar Aug 14 '24 17:08 deadprogram

@deadprogram it seems broken again:

io:~/src/tinygo/pico/sx127x> go mod tidy go: errors parsing go.mod: go.mod:5: unrecognized import path "tinygo.org/x/drivers/sx127x": reading https://tinygo.org/x/drivers/sx127x?go-get=1: 404 Not Found

changing to drop the x: io:~/src/tinygo/pico/sx127x> go mod tidy go: errors parsing go.mod: go.mod:5: unrecognized import path "tinygo.org/drivers/sx127x": reading https://tinygo.org/drivers/sx127x?go-get=1: 404 Not Found

Is this me?

gherlein avatar Mar 26 '25 14:03 gherlein