chore: spelling and grammar fixes (#2865)

This commit is contained in:
Ville Skyttä 2022-05-20 03:59:31 +03:00 committed by GitHub
parent 907ecf3226
commit 86bd842377
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -49,12 +49,12 @@ 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)
@ -62,7 +62,7 @@ func (p *hunkChangesParser) parseDiffLines(h *diffpkg.Hunk) {
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, "+")
@ -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)

View File

@ -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)