-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
math/big: doesn't have example in the documentation for each function #59321
Comments
This comment was marked as spam.
This comment was marked as spam.
see https://pkg.go.dev/math/big I think the package documentation clearly states not to check nil. Copy the original words: For instance, NewInt (x) returns an * Int set to the value of the int64 argument x, NewRat (a, b) returns a * Rate set to the fraction a/b where a and b are int64 values, and NewFloat (f) returns a * Float initialized to the float64 argument f I saw help wanted, but I'm not sure if math/big really needs to add example. |
@qiulaidongfeng From the original words you copied and pasted, I don't see to clearly stay not to check nil. |
Let's not get bogged down on |
For functions or methods without examples, except for those that implement specific interfaces such as MarshalText, this CL ensures at least one example. For golang#59321 Change-Id: Id990f75a8d1da1f01fb143ba48315ea9529489f5
I am interested in solving this issue. Who knows how to assign this issue to me? I plan to address this issue during the go1.22 development cycle. Who knows how to set the milestone for this issue as the go1.22 milestone? |
Change https://go.dev/cl/533278 mentions this issue: |
For functions or methods without examples, except for those that implement specific interfaces such as MarshalText, this CL ensures at least one example. For golang#59321 Change-Id: Id990f75a8d1da1f01fb143ba48315ea9529489f5
For functions or methods without examples, except for those that implement specific interfaces such as MarshalText, this CL ensures at least one example. For golang#59321 Change-Id: Id990f75a8d1da1f01fb143ba48315ea9529489f5
For functions or methods without examples, except for those that implement specific interfaces such as MarshalText, this CL ensures at least one example. For golang#59321 Change-Id: Id990f75a8d1da1f01fb143ba48315ea9529489f5
For functions or methods without examples, except for those that implement specific interfaces such as MarshalText, this CL ensures at least one example. For golang#59321 Change-Id: Id990f75a8d1da1f01fb143ba48315ea9529489f5
This makes the package a bit hard to use and I'm not sure I properly use it.
For example, NewRat return a *Rat, I have no idea if I should or not check for a nil value?
Adding examples should clarify a lot of questons.
The text was updated successfully, but these errors were encountered: