semantic versioning & Deprecated function

247 views
Skip to first unread message

Jérôme LAFORGE

unread,
Oct 9, 2020, 2:40:58 PM10/9/20
to golang-nuts
Hello Gophers,
From your point of view, is it acceptable to deprecate (// Deprecated: xxx) a function or something else into a Module with the change on its patch version number? (from 1.0.0 to 1.0.1).

Thx in adv
Best
Jérôme

David Skinner

unread,
Oct 9, 2020, 8:18:11 PM10/9/20
to golang-nuts
https://semver.org/
It is MAJOR.MINOR.PATCH
If you fix a bug, increment PATCH
If add a feature, increment MINOR
If you deprecate a feature, increment MAJOR. unless MAJOR is 0 then you increment MINOR.

peterGo

unread,
Oct 10, 2020, 1:01:38 AM10/10/20
to golang-nuts
Jérôme,

Semantic Versioning 2.0.0
https://semver.org/#semantic-versioning-200

How should I handle deprecating functionality?
https://semver.org/#how-should-i-handle-deprecating-functionality

Deprecating existing functionality is a normal part of software development and is often required to make forward progress. When you deprecate part of your public API, you should do two things: (1) update your documentation to let users know about the change, (2) issue a new minor release with the deprecation in place. Before you completely remove the functionality in a new major release there should be at least one minor release that contains the deprecation so that users can smoothly transition to the new API.

Peter

peterGo

unread,
Oct 10, 2020, 1:13:07 AM10/10/20
to golang-nuts
Jérôme,

Semantic Versioning Specification (SemVer)
https://semver.org/#semantic-versioning-specification-semver

7. Minor version Y (x.Y.z | x > 0) ... MUST be incremented if any public API functionality is marked as deprecated.
https://semver.org/#spec-item-7

Peter

On Friday, October 9, 2020 at 2:40:58 PM UTC-4, Jérôme LAFORGE wrote:

Jérôme LAFORGE

unread,
Oct 10, 2020, 1:59:46 AM10/10/20
to golang-nuts
Thank you all for your help.
Reply all
Reply to author
Forward
0 new messages