Use &struct{} instead of new

This commit is contained in:
Charles committed 2015-09-16 22:27:36 +08:00
1 parent cc3f374623
commit 12ea3b8e28
7 files changed
+53 -50

No files matched your search

+4 -4
View File
@@ -27,14 +27,14 @@ type SocksServer struct {
}
func NewSocksServer(vp *core.Point, rawConfig []byte) *SocksServer {
server := new(SocksServer)
server.vPoint = vp
config, err := loadConfig(rawConfig)
if err != nil {
panic(log.Error("Unable to load socks config: %v", err))
}
server.config = config
return server
return &SocksServer{
vPoint: vp,
config: config,
}
}
func (server *SocksServer) Listen(port uint16) error {