jostyee / gomock

Automatically exported from code.google.com/p/gomock
Apache License 2.0
0 stars 0 forks source link

gomock creates mocks that fail golint #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run mockgen 
2. run golint
3. get errors

What is the expected output? What do you see instead?

I see the error listed below, I assumed gomock would at least put comment 
placeholders in the autogen'd code

"mock_repository.go:94:1: exported method MockFooRepository.PutBar should have 
comment or be unexported"

What version of the product are you using? On what operating system?
using golang 1.4 on osx

Please provide any additional information below.

Original issue reported on code.google.com by JimI...@gmail.com on 19 Feb 2015 at 6:43

GoogleCodeExporter commented 9 years ago
Easy solution: don't run golint on generated code. Golint is for humans, not 
for machines.

Original comment by dsymo...@golang.org on 19 Feb 2015 at 8:21

GoogleCodeExporter commented 9 years ago
that's silly, all you have to do is add a comment above the func. Most people 
want to run golint recursively on their project. There's no reason generated 
code can't pass golint. A human may need to inspect that some day. 

Original comment by JimI...@gmail.com on 19 Feb 2015 at 8:58