Skip to content

Commit

Permalink
satisfy the linter
Browse files Browse the repository at this point in the history
correcting missspell and adding toplevel-comment period
  • Loading branch information
treilik committed Sep 22, 2021
1 parent 1f6dd86 commit ea525b1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions wordwrap/wordwrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ type WordWrap struct {
Newline []rune
KeepNewlines bool
HardWrap bool
TabReplace string // since tabs can have differrent lenghts, replace them with this when hardwrap is enabled
TabReplace string // since tabs can have differrent lengths, replace them with this when hardwrap is enabled
PreserveSpaces bool

buf bytes.Buffer // processed and, in line, accepted bytes
space bytes.Buffer // pending continues spaces bytes
word ansi.Buffer // pending continues word bytes

lineLen int // the visible lenght of the line not accorat for tabs
lineLen int // the visible length of the line not accorat for tabs
ansi bool

wroteBegin bool // mark is since the last newline something has writen to the buffer (for ansi restart)
Expand Down Expand Up @@ -65,7 +65,7 @@ func String(s string, limit int) string {
}

// HardWrap is a shorthand for declaring a new hardwraping WordWrap instance,
// since varibale lenght characters can not be hard wraped to a fixed lenght,
// since varibale length characters can not be hard wraped to a fixed length,
// tabs will be replaced by TabReplace, use according amount of spaces.
func HardWrap(s string, limit int, tabReplace string) string {
f := NewWriter(limit)
Expand All @@ -77,7 +77,7 @@ func HardWrap(s string, limit int, tabReplace string) string {
return f.String()
}

// addes pending spaces to the buf(fer) ... and resets the space buffer
// addes pending spaces to the buf(fer) and then resets the space buffer.
func (w *WordWrap) addSpace() {
// the line and the pending spaces are less than the limit
if w.lineLen+w.space.Len() <= w.Limit {
Expand Down Expand Up @@ -231,13 +231,13 @@ func (w *WordWrap) Close() error {
}

// Bytes returns the word-wrapped result as a byte slice.
// Make sure to have closed the worwrapper, befor calling it
// Make sure to have closed the worwrapper, befor calling it.
func (w *WordWrap) Bytes() []byte {
return w.buf.Bytes()
}

// String returns the word-wrapped result as a string.
// Make sure to have closed the worwrapper, befor calling it
// Make sure to have closed the worwrapper, befor calling it.
func (w *WordWrap) String() string {
return w.buf.String()
}

0 comments on commit ea525b1

Please sign in to comment.