Go: Add gotype support (#1099)

This commit is contained in:
Jelte Fennema
2018-01-07 13:11:01 +01:00
committed by w0rp
parent c9d66b861b
commit b6d1c41925
6 changed files with 51 additions and 2 deletions

View File

@@ -0,0 +1,19 @@
Before:
runtime ale_linters/go/gotype.vim
call ale#test#SetFilename('../go_files/testfile2.go')
After:
call ale#linter#Reset()
Execute(The gotype callback should include other files from the directory but exclude the file itself):
let dir = expand('#' . bufnr('') . ':p:h')
AssertEqual
\ "gotype %t ". ale#Escape(ale#path#Simplify(dir . "/testfile.go")),
\ ale_linters#go#gotype#GetCommand(bufnr(''))
Execute(The gotype callback should ignore test files):
call ale#test#SetFilename('bla_test.go')
AssertEqual
\ 0,
\ ale_linters#go#gotype#GetCommand(bufnr(''))