Comments (5)
Hi there!
Thanks for sending this in. This is something I've been aware of for some time, just haven't gotten time to fix. So let's chat about it 😄
The Go docs suggest:
Note that if you are adopting modules for the first time for a pre-existing repository or set of packages that have already been tagged v2.0.0 or higher before adopting modules, then the recommended best practice is to increment the major version when first adopting modules. For example, if you are the author of foo, and the latest tag for the foo repository is v2.2.2, and foo has not yet adopted modules, then the best practice would be to use v3.0.0 for the first release of foo to adopt modules (and hence the first release of foo to contain a go.mod file).
This is why I'd lean towards doing the following:
- Changing the
module
in thego.mod
to include/v5
. - Tagging a new v5.0.0 release
This should get modules working where v5.0.0. While there may be some issues with certain clients like dep, it feels like it's the correct and most simple approach to more proper module support.
What do you think?
from email.
@JensRantil @l-ross Could you help me review this issue? Thx :p
from email.
@jordan-wright Thank you for your reply.
You can see your downstream repos through this link:
https://github.com/search?l=Go&q=github.com%2Fjordan-wright%2Femail&type=Code
And your downstream module user can be seen here:
https://github.com/search?q=github.com%2Fjordan-wright%2Femail+extension%3Amod&type=Code
Downstream repos that use dep、glide and so on, can be seen here:
https://github.com/search?q=github.com%2Fjordan-wright%2Femail+extension%3Ajson+extension%3Aconf+extension%3Atoml+extension%3Alock&type=Code
If you want to be compatible with all the downstream, maybe you could consider using one of two options:
- Delete the go.mod file when you send a commit.
- Create the repo using the "Major subdirectory" method
Major subdirectory: Create a new v3 subdirectory (e.g., my/module/v3) and place a new go.mod file in that subdirectory. The module path must end with /v3. Copy or move the code into the v3 subdirectory. Update import statements within the module to also use /v3 (e.g., import "github.com/my/module/v3/mypkg"). Tag the release with v3.0.0.
- This provides greater backwards-compatibility. In particular, Go versions older than 1.9.7 and 1.10.3 are also able to properly consume and build a v2+ module created using this approach.
- A more sophisticated approach here could exploit type aliases (introduced in Go 1.9) and forwarding shims between major versions residing in different subdirectories. This can provide additional compatibility and allow one major version to be implemented in terms of another major version but would entail more work for a module author. An in-progress tool to automate this is goforward. Please see here for more details and rationale, along with a functioning initial version of goforward.
- Pre-existing dependency management solutions such as dep should be able to consume a v2+ module created in this way.
from email.
@jordan-wright
The "mixed" dependency management modes (GOPATH and Go modules) in the Go ecosysem can cause tons of issues.
Having a global view of your downstream and upstream projects and their migration situations (to Go Modules) can help you select a better solution by making a trade-off analysis, which aims to avoid introducing breaking changes into other projects in the community :p
Do you agree with the above opinion?
Hope my provided information about your downstream and upstream projects are useful.
Thanks again.
Best regards.
from email.
Hi @KateGo520,
Thanks for all the great feedback. I've opted to take the easy way out here for now and just removed the go.mod file. In the future, I'll consider a different option when I'm ready to cut a new major release.
from email.
Related Issues (20)
- How to accept email HOT 1
- BUG: HTMLRelated attachments with only HTML HOT 3
- Start sending after client was idle for a while: tcp write: broken pipe HOT 4
- NewEmailFromReader is not handling multiple To, Cc and Bcc addresses correctly HOT 1
- cc and bcc not working
- Use mail.Address instead of plain strings HOT 3
- Q: how to use inline assets? HOT 2
- Old Content-Type headers are retained after email MIME content is generated with Bytes()
- Email.Headers.Add("Bcc"…) does not do what one might think HOT 3
- Non-multipart emails are not decoded when CTE is Base64
- Missing MIMe headers with NewEmailFromReader HOT 2
- Data Race in Connection Pool
- email should use base64 encoding as default for html to avoid dot-stuffing
- text decoding support for NewEmailFromReader
- Incorrect encoding for utf-8 characters in reply-to addresses HOT 1
- Hello author, about proxy IP
- SendWithStartTLS:504 5.7.4 Unrecognized authentication type [HK2PR04CA0063.apcprd04.prod.outlook.com] HOT 1
- How do I add attachments to the body HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from email.