Fixing a few golint issues

This commit is contained in:
Sarah Jamie Lewis 2018-01-05 14:16:52 -08:00
parent f6cc472c6e
commit 05e8675ed5
5 changed files with 9 additions and 6 deletions

View File

@ -38,8 +38,7 @@ Format your code (the path might be slightly different):
Run the following commands, and address any issues which arise: Run the following commands, and address any issues which arise:
* `go vet github.com/s-rah/go-ricochet/...` * `go vet github.com/s-rah/go-ricochet/...`
* `golint github.com/s-rah/go-ricochet` * `/golint application/ channels/ connection/ examples/ identity/ policies/ testing/ utils`
* `golint github.com/s-rah/go-ricochet/utils`
## 4. Code Review ## 4. Code Review

View File

@ -34,6 +34,7 @@ func (ach *AutoConnectionHandler) OnReady(oc *Connection) {
func (ach *AutoConnectionHandler) OnClosed(err error) { func (ach *AutoConnectionHandler) OnClosed(err error) {
} }
// GetSupportedChannelTypes returns a list of channel types that are registered with the handler.
func (ach *AutoConnectionHandler) GetSupportedChannelTypes() []string { func (ach *AutoConnectionHandler) GetSupportedChannelTypes() []string {
supported := []string{} supported := []string{}
for k := range ach.handlerMap { for k := range ach.handlerMap {

View File

@ -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) { func (rc *Connection) EnableFeatures(features []string) {
messageBuilder := new(utils.MessageBuilder) messageBuilder := new(utils.MessageBuilder)
raw := messageBuilder.EnableFeatures(features) raw := messageBuilder.EnableFeatures(features)
rc.SendRicochetPacket(rc.Conn, 0, raw) 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) { func (rc *Connection) traceLog(message string) {
if rc.trace { if rc.trace {
log.Printf(message) log.Printf(message)

View File

@ -88,7 +88,3 @@ func (och *OutboundConnectionHandler) ProcessAuthAsClient(identity identity.Iden
} }
return false, utils.ServerRejectedClientConnectionError return false, utils.ServerRejectedClientConnectionError
} }
func (och *OutboundConnectionHandler) GetSupportChannels() {
}

View File

@ -7,7 +7,10 @@ import (
) )
const ( const (
// InvalidPacketLengthError is returned whenever ricochet receives a packet too small or too large to conform to the spec.
InvalidPacketLengthError = Error("InvalidPacketLengthError") InvalidPacketLengthError = Error("InvalidPacketLengthError")
// InvalidChannelIDError channels must be between 0 and 65535
InvalidChannelIDError = Error("InvalidChannelIDError") InvalidChannelIDError = Error("InvalidChannelIDError")
) )