mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-27 05:15:47 +00:00
cleanup logging
This commit is contained in:
@@ -23,24 +23,24 @@ func init() {
|
||||
host, ok := params["host"]
|
||||
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("udp client requires a host parameter")
|
||||
return nil, fmt.Errorf("net.udp.client requires a host parameter")
|
||||
}
|
||||
|
||||
hostString, ok := host.(string)
|
||||
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("udp client host must be uint16")
|
||||
return nil, fmt.Errorf("net.udp.client host must be uint16")
|
||||
}
|
||||
|
||||
port, ok := params["port"]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("udp client requires a port parameter")
|
||||
return nil, fmt.Errorf("net.udp.client requires a port parameter")
|
||||
}
|
||||
|
||||
portNum, ok := port.(float64)
|
||||
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("udp client port must be uint16")
|
||||
return nil, fmt.Errorf("net.udp.client port must be uint16")
|
||||
}
|
||||
|
||||
return &UDPClient{Host: hostString, Port: uint16(portNum), config: config}, nil
|
||||
@@ -80,7 +80,7 @@ func (uc *UDPClient) Output(payload any) error {
|
||||
if uc.conn != nil {
|
||||
payloadBytes, ok := payload.([]byte)
|
||||
if !ok {
|
||||
return fmt.Errorf("udp-client is only able to output bytes")
|
||||
return fmt.Errorf("net.udp.client is only able to output bytes")
|
||||
}
|
||||
_, err := uc.conn.Write(payloadBytes)
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user