Skip to content

Commit

Permalink
Shift indexes of Row, Column
Browse files Browse the repository at this point in the history
  • Loading branch information
vodkabears committed May 13, 2017
1 parent 12b407b commit e414cd4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion checker/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func (e Error) Error() string {
file := e.Chunk.File
lastIndex := len(e.Misspells) - 1
for i, m := range e.Misspells {
str += fmt.Sprintf("%s:%d:%d: %s", file, m.Row, m.Col, m.Word)
str += fmt.Sprintf("%s:%d:%d: %s", file, m.Row+1, m.Col+1, m.Word)
if len(m.Suggestions) > 0 {
str += fmt.Sprintf(" %v", m.Suggestions)
}
Expand Down
4 changes: 2 additions & 2 deletions checker/error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ func TestCheckerError(t *testing.T) {
&reader.Chunk{"file.txt", "test"},
misspells,
}
expected := "file.txt:0:0: Golang\n" +
"file.txt:1:0: Goroutines [Go routines]"
expected := "file.txt:1:1: Golang\n" +
"file.txt:2:1: Goroutines [Go routines]"

if err.Error() != expected {
t.Errorf("\nExpected to get:\n%s.\nGot:\n%s", err, expected)
Expand Down

0 comments on commit e414cd4

Please sign in to comment.