-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Use a different template for test files #1318
Conversation
templates/hello_world_test.go
Outdated
import "testing" | ||
|
||
func TestHelloWorld(t *testing.T) { | ||
t.Fatal("not implemented") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be commented out by default. It's better to give people a clean pkg instead of a test that's fails. Could you comment this out? The function body should be like:
// t.Fatal("not implemented")
doc/vim-go.txt
Outdated
default the `hello_world_test.go` file is used. | ||
> | ||
let g:go_template_test_file = "hello_world_test.go" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the <
character is missing here
doc/vim-go.txt
Outdated
with a Go code template. By default the template under | ||
`templates/hello_world.go` is used. This can be changed with the | ||
|'g:go_template_file'| setting. | ||
with a Go code template. By default, the templates under `templates` are used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think under templates folder are used ...
is better. People might not know that we have a templates
folder.
Thanks @bhcleek. A couple of improvements, once you fix them this is good to go |
Use a template more appropriate for test files than templates/hello_world.go when creating a test file in a directory with no Go files present. A new option, g:go_template_test_file, allows users to specify their own template to use.
cac97ee
to
f4be8f6
Compare
PTAL |
Thanks @bhcleek 👍 |
Use a template more appropriate for test files than templates/hello_world.go
when creating a test file in a directory with no Go files present. A new
option, g:go_template_test_file, allows users to specify their own template to
use.
Fixes #1216