d2r2 / go-dht

Golang library to interact with DHT11/DHT22/DHT12 temperature and humidity sensors from Raspberry PI.
MIT License
133 stars 52 forks source link

golint warnings #17

Closed jnovack closed 5 years ago

jnovack commented 5 years ago
dht.go:19: exported type SensorType should have comment or be unexported
dht.go:22: receiver name should be a reflection of its identity; don't use generic
           names such as "this" or "self"
dht.go:35: comment on exported const DHT11 should be of the form "DHT11 ..."
dht.go:37: comment on exported const DHT22 should be of the form "DHT22 ..."
dht.go:39: comment on exported const AM2302 should be of the form "AM2302 ..."
dht.go:43: comment on exported type Pulse should be of the form "Pulse ..."
           (with optional leading article)
dht.go:55: should drop = 0 from declaration of var boost; it is the zero value
dht.go:83: should drop = 0 from declaration of var value; it is the zero value
dht.go:99: should drop = 0 from declaration of var b; it is the zero value
dht.go:109: don't use ALL_CAPS in Go names; use CamelCase
dht.go:112: don't use ALL_CAPS in Go names; use CamelCase
dht.go:175: if block ends with a return statement, so drop this else and outdent
            its block
dht.go:212: comment on exported function ReadDHTxx should be of the form
            "ReadDHTxx ..."
dht.go:243: comment on exported function ReadDHTxxWithRetry should be of the form 
            "ReadDHTxxWithRetry ..."
dht.go:280: error strings should not be capitalized or end with punctuation or a newline

These seem to be easy fixes, mind if I just do them?

d2r2 commented 5 years ago

Hi @jnovack, I do not mind if you do this job!

The only thing - do not change constants ALL_CAPS case to CamelCase, since these literals are public and I don't want to break public API because it exist for a while.

P.S. Hour ago I just made new pull request where added new API call and made some improvements in call responsiveness. So take latest changes, please, and go on. I don't have any more plans to change anything.