18}
19
20// readGradient TODO Read from File or Transfer between Processes.
21func (that *Peer) readGradient(path string) []float64 {22 return []float64{}
23}
24
20 }, 9000)
21}
22
23func TestRequestViaTcp4(t *testing.T) {24 data := []byte("Message.")
25 RequestViaTcp4("127.0.0.1", 9000, func(conn *net.Conn, port uint, data []byte) {
26 _, err := (*conn).Write(data)
6 "testing"
7)
8
9func TestListenViaTcp4(t *testing.T) {10 ListenViaTcp4(func(conn *net.Conn) {
11 data := make([]byte, 1024)
12 length, err := (*conn).Read(data)
7 "time"
8)
9
10func TestStartOrigin(t *testing.T) {11 StartOrigin()
12}
13
52 return pList
53}
54
55func (that *PeerInfo) UdpListen(f func([]byte), ctx context.Context) {56 // TODO Using context for interrupting.
57 udp.ListenViaUdp4(f, that.Port)
58}
Unused parameters in functions or methods should be replaced with _
(underscore) or removed.
Functions or methods with unused parameters can be a symptom of unfinished
refactoring or a bug. If an unused parameter is present, it should be named _
(underscore) to avoid raising this issue and better readability.
func abc(unused string) {
fmt.Println("Not using any passed params.")
}
func abc(_ string) {
fmt.Println("Not using any passed params.")
}
func abc() {
fmt.Println("Not using any passed params.")
}