Uh oh!
There was an error while loading. Please reload this page.
Implement range object - #87
Conversation
| } | ||
| func (r *Range) repr() (Object, error) { | ||
| var out bytes.Buffer |
There was a problem hiding this comment.
consider using strings.Builder instead? (needs Go >= 1.10, though)
There was a problem hiding this comment.
strings.Builder is more recommended way :)
There was a problem hiding this comment.
I modified the code. Would you please review it again?
Codecov Report
@@ Coverage Diff @@## master #87 +/- ##
=========================================
+ Coverage 68.84% 68.9% +0.05%
=========================================
Files 59 60 +1 Lines 10545 10599 +54 =========================================
+ Hits 7260 7303 +43 - Misses 2775 2780 +5 - Partials 510 516 +6
Continue to review full report at Codecov.
|
__repr__ print start, stop of range if step is not one, step is also printed Fixesgo-python#86
__eq__ compare length, start, step of range
| } | ||
| func (r *Range) repr() (Object, error) { | ||
| var b strings.Builder |
There was a problem hiding this comment.
Since strings.Builder is not supported at go < 1.10
You need to use version constraints.
Read this article. https://medium.com/@theckman/version-constraints-and-go-c9309be15773
example:
https://github.com/corona10/goimagehash/blob/master/imagehash18.go
https://github.com/corona10/goimagehash/blob/master/imagehash19.go
2a572a1 to
f222b3dComparestrings.Builder is supported since v1.10, so split files for older versions
Implement
__repr__,__str__,__eq__,__ne__of rangeFixes#86