Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: spelling and grammar fixes #2865

Merged
merged 1 commit into from May 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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