Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/fsutils/linecache.go
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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