4 ms·
sorry is github.com/username/module is much worse than com.arbitrary.x.y.z ?
by zht 5y ago
sorry is github.com/username/module is much worse than
com.arbitrary.x.y.z ?
- tkiolp4 5y agoIn the source file one could just say import “username/module” And in the go.mod file the whole URL can stay require github.com/username/module v1.2.3 I only see advantages with this approach and I imagine it’s a rather “easy to add” feature that can be even backwards compatible.
- klabb3 5y agoI would take this further, simply `import "module"` would be nicer. (I don't care about anyone's github username, and I often need to fork projects and today that means mindless search and replace) Conflict resolution within the same module could be handled in the go.mod file: `require alias github.com/...`
- philosopher1234 5y agoWhat if I publish gitlab.com/username/module and i dont know anything about your github project? This seems like a pretty obvious disadvantage, so its surprising you failed to see it. What are the advantages?
- klabb3 5y agoShamelessly pasting my reply to parent: > Conflict resolution within the same module could be handled in the go.mod file: > `require alias github.com/...`