EternallyAscend / GoToolkits

Found redundant control flow SCC-S1023
Anti-pattern
Major
a year ago2 years old
redundant return statement
84	that.join()
85	// Add Timer for Refresh and so on.
86	that.fetch()
87	return88}
89
90func (that *Peer) Exit() {
redundant break statement
57			}
58			delete(peer.Router.Neighbor, neighbor.HashString())
59			log.Println(neighbor, "exit blockchain network.")
60			break61		default:
62			break
63		}
redundant break statement
49				//}
50				log.Println(peerInfo, "ask for blockchain network.")
51			}
52			break53		case UdpMethodExit:
54			neighbor := UnpackPeerInfo(p.Message)
55			if nil == neighbor {
redundant break statement
 50				return
 51			}
 52			go neighbor.UdpSendToPeer(packByte)
 53			break 54		case UdpMethodReceive:
 55			log.Println("UdpMethodReceive")
 56			neighbor := UnpackPeerInfoList(p.Message)
redundant return statement
161			length = len(that.Router.Neighbor)
162		}
163	}
164	return165}
166
167func (that *Peer) exit() {