Skip to content

Commit

Permalink
chore: spelling and grammar fixes (#2865)
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed May 20, 2022
1 parent 907ecf3 commit 86bd842
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/fsutils/linecache.go
Expand Up @@ -21,7 +21,7 @@ func NewLineCache(fc *FileCache) *LineCache {
}
}

// GetLine returns a index1-th (1-based index) line from the file on filePath
// GetLine returns the index1-th (1-based index) line from the file on filePath
func (lc *LineCache) GetLine(filePath string, index1 int) (string, error) {
if index1 == 0 { // some linters, e.g. gosec can do it: it really means first line
index1 = 1
Expand Down
8 changes: 4 additions & 4 deletions pkg/golinters/gofmt_common.go
Expand Up @@ -49,20 +49,20 @@ type hunkChangesParser struct {

func (p *hunkChangesParser) parseDiffLines(h *diffpkg.Hunk) {
lines := bytes.Split(h.Body, []byte{'\n'})
currentOriginalLineNumer := int(h.OrigStartLine)
currentOriginalLineNumber := int(h.OrigStartLine)
var ret []diffLine

for i, line := range lines {
dl := diffLine{
originalNumber: currentOriginalLineNumer,
originalNumber: currentOriginalLineNumber,
}

lineStr := string(line)

if strings.HasPrefix(lineStr, "-") {
dl.typ = diffLineDeleted
dl.data = strings.TrimPrefix(lineStr, "-")
currentOriginalLineNumer++
currentOriginalLineNumber++
} else if strings.HasPrefix(lineStr, "+") {
dl.typ = diffLineAdded
dl.data = strings.TrimPrefix(lineStr, "+")
Expand All @@ -74,7 +74,7 @@ func (p *hunkChangesParser) parseDiffLines(h *diffpkg.Hunk) {

dl.typ = diffLineOriginal
dl.data = strings.TrimPrefix(lineStr, " ")
currentOriginalLineNumer++
currentOriginalLineNumber++
}

ret = append(ret, dl)
Expand Down
2 changes: 1 addition & 1 deletion pkg/golinters/gosimple.go
Expand Up @@ -14,7 +14,7 @@ func NewGosimple(settings *config.StaticCheckSettings) *goanalysis.Linter {

return goanalysis.NewLinter(
"gosimple",
"Linter for Go source code that specializes in simplifying a code",
"Linter for Go source code that specializes in simplifying code",
analyzers,
nil,
).WithLoadMode(goanalysis.LoadModeTypesInfo)
Expand Down

0 comments on commit 86bd842

Please sign in to comment.