Skip to content

Commit b99e7fd

Browse files
g41797linkdotnet
authored andcommitted
Remove Skip()
1 parent e932728 commit b99e7fd

File tree

3 files changed

+0
-38
lines changed

3 files changed

+0
-38
lines changed

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ All notable changes to **ValueStringBuilder** will be documented in this file. T
99
### Added
1010

1111
- `SetRuneAt` is added to the string builder
12-
- `Skip` is added to the string builder
1312

1413
## [0.10.0] - 2023-08-31
1514

stringbuilder.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -349,20 +349,3 @@ func (s *StringBuilder) SetRuneAt(index int, val rune) error {
349349

350350
return nil
351351
}
352-
353-
// Change current position
354-
func (s *StringBuilder) Skip(forward int) error {
355-
if forward <= 0 {
356-
return fmt.Errorf("forward should always be greater than zero")
357-
}
358-
359-
newPos := s.position + forward
360-
361-
if newPos >= len(s.data) {
362-
return fmt.Errorf("cannot skip after end of string builder")
363-
}
364-
365-
s.position = newPos
366-
367-
return nil
368-
}

stringbuilder_test.go

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -511,23 +511,3 @@ func TestSetRuneAt(t *testing.T) {
511511
t.Errorf("Actual %q, Expected: %q", result, 'e')
512512
}
513513
}
514-
515-
func TestSkip(t *testing.T) {
516-
sb := NewStringBuilderFromString("Hello")
517-
518-
err := sb.Skip(1)
519-
if err == nil {
520-
t.Errorf("Should throw error but did not")
521-
}
522-
523-
sb.Clear()
524-
525-
err = sb.Skip(1)
526-
if err != nil {
527-
t.Errorf("Should not throw error")
528-
}
529-
530-
if sb.position != 1 {
531-
t.Errorf("Actual position %d, Expected: 1", sb.position)
532-
}
533-
}

0 commit comments

Comments
 (0)