Feat #305: Golinting

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
This commit is contained in:
Hector Sanjuan 2018-03-16 13:08:11 +01:00
parent 73581b0471
commit f74c7b2c6e
2 changed files with 3 additions and 3 deletions

View File

@ -131,7 +131,7 @@ func (c *Client) setupHTTPClient() error {
var prot ipnet.Protector var prot ipnet.Protector
if c.config.ProtectorKey != nil && len(c.config.ProtectorKey) > 0 { if c.config.ProtectorKey != nil && len(c.config.ProtectorKey) > 0 {
if len(c.config.ProtectorKey) != 32 { if len(c.config.ProtectorKey) != 32 {
return errors.New("Length of ProtectorKey should be 32") return errors.New("length of ProtectorKey should be 32")
} }
var key [32]byte var key [32]byte
copy(key[:], c.config.ProtectorKey) copy(key[:], c.config.ProtectorKey)

View File

@ -40,11 +40,11 @@ var (
// ErrNoEndpointEnabled is returned when the API is created but // ErrNoEndpointEnabled is returned when the API is created but
// no HTTPListenAddr, nor libp2p configuration fields, nor a libp2p // no HTTPListenAddr, nor libp2p configuration fields, nor a libp2p
// Host are provided. // Host are provided.
ErrNoEndpointsEnabled = errors.New("Neither the libp2p nor the HTTP endpoints are enabled") ErrNoEndpointsEnabled = errors.New("neither the libp2p nor the HTTP endpoints are enabled")
// ErrHTTPEndpointNotEnabled is returned when trying to perform // ErrHTTPEndpointNotEnabled is returned when trying to perform
// operations that rely on the HTTPEndpoint but it is disabled. // operations that rely on the HTTPEndpoint but it is disabled.
ErrHTTPEndpointNotEnabled = errors.New("The HTTP endpoint is not enabled") ErrHTTPEndpointNotEnabled = errors.New("the HTTP endpoint is not enabled")
) )
// API implements an API and aims to provides // API implements an API and aims to provides