decimal icon indicating copy to clipboard operation
decimal copied to clipboard

Deprecated API

Open jerome-laforge opened this issue 3 years ago • 1 comments

Could you use the correct format for deprecated API. According to https://github.com/golang/go/wiki/Deprecated, the deprecated API must follow this.

Plz find an example of resolve below

diff --git a/decimal.go b/decimal.go
index 4876f8c..26c1a59 100644
--- a/decimal.go
+++ b/decimal.go
@@ -681,7 +681,9 @@ func (d Decimal) Equal(d2 Decimal) bool {
 	return d.Cmp(d2) == 0
 }
 
-// Equals is deprecated, please use Equal method instead
+// Equals returns whether the numbers represented by d and d2 are equal.
+//
+// Deprecated:  please use Equal method instead
 func (d Decimal) Equals(d2 Decimal) bool {
 	return d.Equal(d2)
 }
@@ -1244,7 +1246,8 @@ func (d *Decimal) GobDecode(data []byte) error {
 }
 
 // StringScaled first scales the decimal then calls .String() on it.
-// NOTE: buggy, unintuitive, and DEPRECATED! Use StringFixed instead.
+//
+// Deprecated: buggy and unintuitive. Use StringFixed instead.
 func (d Decimal) StringScaled(exp int32) string {
 	return d.rescale(exp).String()
 }

jerome-laforge avatar Apr 08 '21 08:04 jerome-laforge

I had no idea there is a well-known depreciation doc format. Thanks a lot for letting me know! :3

mwoss avatar Apr 10 '21 17:04 mwoss