Fixing a few golint issues
This commit is contained in:
parent
f6cc472c6e
commit
05e8675ed5
|
@ -38,8 +38,7 @@ Format your code (the path might be slightly different):
|
|||
Run the following commands, and address any issues which arise:
|
||||
|
||||
* `go vet github.com/s-rah/go-ricochet/...`
|
||||
* `golint github.com/s-rah/go-ricochet`
|
||||
* `golint github.com/s-rah/go-ricochet/utils`
|
||||
* `/golint application/ channels/ connection/ examples/ identity/ policies/ testing/ utils`
|
||||
|
||||
## 4. Code Review
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ func (ach *AutoConnectionHandler) OnReady(oc *Connection) {
|
|||
func (ach *AutoConnectionHandler) OnClosed(err error) {
|
||||
}
|
||||
|
||||
// GetSupportedChannelTypes returns a list of channel types that are registered with the handler.
|
||||
func (ach *AutoConnectionHandler) GetSupportedChannelTypes() []string {
|
||||
supported := []string{}
|
||||
for k := range ach.handlerMap {
|
||||
|
|
|
@ -480,12 +480,16 @@ func (rc *Connection) controlPacket(handler Handler, res *Protocol_Data_Control.
|
|||
}
|
||||
}
|
||||
|
||||
// EnableFeatures sends an EnableFeatures messages which includes the
|
||||
// list of `features`
|
||||
func (rc *Connection) EnableFeatures(features []string) {
|
||||
messageBuilder := new(utils.MessageBuilder)
|
||||
raw := messageBuilder.EnableFeatures(features)
|
||||
rc.SendRicochetPacket(rc.Conn, 0, raw)
|
||||
}
|
||||
|
||||
// traceLog is an internal function which only logs messages
|
||||
// if the connection is configured to log.
|
||||
func (rc *Connection) traceLog(message string) {
|
||||
if rc.trace {
|
||||
log.Printf(message)
|
||||
|
|
|
@ -88,7 +88,3 @@ func (och *OutboundConnectionHandler) ProcessAuthAsClient(identity identity.Iden
|
|||
}
|
||||
return false, utils.ServerRejectedClientConnectionError
|
||||
}
|
||||
|
||||
func (och *OutboundConnectionHandler) GetSupportChannels() {
|
||||
|
||||
}
|
||||
|
|
|
@ -7,7 +7,10 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
// InvalidPacketLengthError is returned whenever ricochet receives a packet too small or too large to conform to the spec.
|
||||
InvalidPacketLengthError = Error("InvalidPacketLengthError")
|
||||
|
||||
// InvalidChannelIDError channels must be between 0 and 65535
|
||||
InvalidChannelIDError = Error("InvalidChannelIDError")
|
||||
)
|
||||
|
||||
|
|
Reference in New Issue