Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.16.0 breaks backwards compatibility #208

Closed
binwiederhier opened this issue Jan 4, 2023 · 3 comments
Closed

v1.16.0 breaks backwards compatibility #208

binwiederhier opened this issue Jan 4, 2023 · 3 comments

Comments

@binwiederhier
Copy link

binwiederhier commented Jan 4, 2023

Hi there, thank you for your great library. I've been using it for ntfy for a while now, and it works great.

In your (very recent) update, you seem to have changed the API (a lot?), and my code does not compile anymore (here: https://github.com/binwiederhier/ntfy/actions/runs/3834669962). Was this an intentional breaking change? Usually Go libraries use a /v2 namespace for breaking changes to not mess with older users. Maybe that would be a better idea? Just a thought, you can obviously do as you please with your lib :-)

For what it's worth, changing this in my app would be easy. And the new API makes more sense.

v1.15.0:

type Backend interface {
	Login(state *ConnectionState, username, password string) (Session, error)
	AnonymousLogin(state *ConnectionState) (Session, error)
}
type Session interface {
	Reset()
	Logout() error
	Mail(from string, opts MailOptions) error
	Rcpt(to string) error
	Data(r io.Reader) error
}

v1.16.0:

type Backend interface {
	NewSession(c *Conn) (Session, error)
}
type Session interface {
	Reset()
	Logout() error
	AuthPlain(username, password string) error
	Mail(from string, opts *MailOptions) error
	Rcpt(to string) error
	Data(r io.Reader) error
}
@emersion
Copy link
Owner

emersion commented Jan 4, 2023

This is 0.16.0, not 1.16.0. Versions 0.X mean that the module still has an unstable API. See https://go.dev/blog/publishing-go-modules#v0-the-initial-unstable-version for more info.

@emersion emersion closed this as completed Jan 4, 2023
@binwiederhier
Copy link
Author

@emersion That's fair. :-) Are you planning on more (a lot of?) breaking changes in the future? If not, I'll work on upgrading to 0.16.0. Otherwise I think I'll just fork it.

Thanks again for the great lib!

@emersion
Copy link
Owner

emersion commented Jan 4, 2023

No more breaking changes are planned at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants