Repository navigation
Description
When the following program is tested:
package main
import "fmt"
func main() {
a := 1
b := 2
if a + b > 6 {
fmt.Println(a + b) // note - no closing brace here
} // this is the last line of the file
The error produced, go: syntax error: unexpected EOF, expecting } (E) is beyond the last line of the file and therefore doesn't appear (in the gutter or on a hover).
When a blank line follows the last closing brace, the error appears on that line, but only until the file is saved.
Expected behavior
It would be nice if any errors that were attributed to nonexistent line numbers were associated with the last line of the program.
Steps to reproduce
See above. Use the standard go maker.
Output from :NeomakeInfo
Neomake debug information
Async support: 1
Current filetype: go
Windows: 0
[shell, shellcmdflag, shellslash]: ['/bin/bash', '-c', 0]
makeprg=make
Enabled makers
For the current filetype ("go", used with :Neomake):
- go
-
append_file: 0
-
args: ['test', '-c', '-o', '/dev/null']
-
auto_enabled: 1
-
cwd: '%:h'
-
errorformat: '%W%f:%l: warning: %m,%E%f:%l:%c:%m,%E%f:%l:%m,%C%\s%+%m,%-G%.%#\[no test files],%-G#%.%#'
-
exe: 'go'
-
postprocess: function('neomake#postprocess#compress_whitespace')
-
serialize: 1
-
serialize_abort_on_error: 1
-
version_arg: 'version'
-
version information (/home/seth/.local/go/bin/go version): go version go1.13.5 linux/amd64
-
- golangci_lint
- append_file: 0
- args: ['run', '--out-format=line-number', '--print-issued-lines=false', '--enable', 'golint']
- auto_enabled: 1
- cwd: '%:h'
- errorformat: '%f:%l:%c: %m,%f:%l: %m'
- exe: 'golangci-lint'
- output_stream: 'stdout'
- version information (/home/seth/dev/go/bin/golangci-lint --version): golangci-lint has version 1.21.0 built from 645e794 on 2019-10-15T1
8:16:56Z
NOTE: you can define g:neomake_go_enabled_makers to configure it (or b:neomake_go_enabled_makers).
For the project (used with :Neomake!):
- makeprg
- append_file: 0
- args: []
- auto_enabled: 1
- errorformat: '%[^"]"%f"%\D%l: %m,"%f"%\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each functio
n it appears in.),%-GIn file included from %f:%l:%c:,%-GIn file included from %f:%l:%c,,%-GIn file included from %f:%l:%c,%-GIn file include
d from %f:%l,%-G%[ ]from %f:%l:%c,%-G%[ ]from %f:%l:,%-G%[ ]from %f:%l,,%-G%[ ]from %f:%l,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,"%f", line %l%
\D%c%[^ ] %m,%D%\a[%\d]: Entering directory %['']%f'',%X%*\a[%*\d]: Leaving directory %*['']%f'',%D%\a: Entering directory %[`'']%f'
mode
',%X%\a: Leaving directory %[`'']%f'',%DMaking %*\a in %f,%f|%l| %m'
- exe: 'make'
- version information (/usr/bin/make --version): GNU Make 4.2.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
NOTE: you can define g:neomake_enabled_makers to configure it.
Default maker settings: - output_stream: 'both'
- remove_invalid_entries: 0
- buffer_output: 1
Settings
New-style (dict, overrides old-style)
g:neomake: {
'automake': {
'ignore_filetypes': [
'startify',
],
'events': {
'BufWritePost': {
'delay': 0,
},
'FileChangedShellPost': {},
'FileType': {},
'BufWinEnter': {},
'InsertLeave': {},
'TextChanged': {},
},
},
'automake_delay': 750,
}
b:neomake: unset
Old-style
g:neomake_error_sign = {'texthl': 'NeomakeErrorSign', 'text': '✖'}
g:neomake_go_golangci_lint_args = ['run', '--out-format=line-number', '--print-issued-lines=false', '--enable', 'golint']
g:neomake_info_sign = {'texthl': 'NeomakeInfoSign', 'text': 'i'}
g:neomake_logfile = '/tmp/neomake.log'
g:neomake_message_sign = {'texthl': 'NeomakeMessageSign', 'text': '➤'}
g:neomake_place_signs = 1
g:neomake_warning_sign = {'texthl': 'NeomakeWarningSign', 'text': '‼'}
:version
NVIM v0.5.0-291-g0c436559d
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototype
s -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=always -DIN
CLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/seth/build/neovim/b
uild/config -I/home/seth/build/neovim/src -I/home/seth/build/neovim/.deps/usr/include -I/usr/include -I/home/seth/build/neovim/build/src/nvim
/auto -I/home/seth/build/neovim/build/include
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototype
s -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=always -DIN
CLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/seth/build/neovim/b
uild/config -I/home/seth/build/neovim/src -I/home/seth/build/neovim/.deps/usr/include -I/usr/include -I/home/seth/build/neovim/build/src/nvim
/auto -I/home/seth/build/neovim/build/include
Compiled by seth@hydrogen
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/home/seth/.local/share/nvim"
Run :checkhealth for more info
:messages
"main.go" [New] 10L, 135C written
Activity
blueyed commentedon Jan 3, 2020
Makes sense.
Except for
< 1, which should be attributed to line 1 then probably.What's the raw output here? Does it have a line number after all?
sbromberger commentedon Jan 3, 2020
Does this help?
blueyed commentedon Jan 3, 2020
Yes, thanks.