livebud / bud

The Full-Stack Web Framework for Go
MIT License
5.53k stars 181 forks source link

using 'change.me' placeholder in go.mod causes network connections to hostname 'change.me' #330

Open sneak opened 1 year ago

sneak commented 1 year ago

When using example/placeholder strings that are interpreted as domain names, the domain example.com should be used.

https://github.com/livebud/bud/blob/d9c7ff63a929c9c308921ae35a929f19c5b101c9/internal/cli/create/create.go#L116

sneak commented 1 year ago

Potential workaround would be to interactively prompt the user for the package URI during create operation.

matthewmueller commented 1 year ago

Hmm, wouldn't example.com also be interpreted as domain name?

There's some prior discussion about this in: https://github.com/livebud/bud/issues/240. The TL;DR was that:

Curious how you ran into this in the first place? Did you run go mod tidy and there was a missing package, so it looked for change.me/some/package and that was confusing?

We could also explore intentionally giving an invalid module name. Maybe that would behave in a more obvious manner.

sneak commented 1 year ago

Hmm, wouldn't example.com also be interpreted as domain name?

Yes, but example.com is always guaranteed to be an innocuous domain name (it's IANA reserved): https://example.com