simplify (*x).f to x.f where it does not change the semantics
Found using https://go-critic.github.io/overview#underef-ref
This commit is contained in:
@ -172,7 +172,7 @@ func (s *HTTP) InitService() (err error) {
|
||||
s.InitLB()
|
||||
}
|
||||
if *s.cfg.DNSAddress != "" {
|
||||
(*s).domainResolver = dnsx.NewDomainResolver(*s.cfg.DNSAddress, *s.cfg.DNSTTL, s.log)
|
||||
s.domainResolver = dnsx.NewDomainResolver(*s.cfg.DNSAddress, *s.cfg.DNSTTL, s.log)
|
||||
}
|
||||
if *s.cfg.ParentType == "ssh" {
|
||||
err = s.ConnectSSH()
|
||||
|
||||
@ -145,7 +145,7 @@ func (s *SPS) CheckArgs() (err error) {
|
||||
func (s *SPS) InitService() (err error) {
|
||||
|
||||
if *s.cfg.DNSAddress != "" {
|
||||
(*s).domainResolver = dnsx.NewDomainResolver(*s.cfg.DNSAddress, *s.cfg.DNSTTL, s.log)
|
||||
s.domainResolver = dnsx.NewDomainResolver(*s.cfg.DNSAddress, *s.cfg.DNSTTL, s.log)
|
||||
}
|
||||
|
||||
if len(*s.cfg.Parent) > 0 {
|
||||
|
||||
@ -208,8 +208,8 @@ func (s *TCP) OutToUDP(inConn *net.Conn) (err error) {
|
||||
srcAddr := ""
|
||||
defer func() {
|
||||
if item != nil {
|
||||
(*(*item).conn).Close()
|
||||
(*item).udpConn.Close()
|
||||
(*item.conn).Close()
|
||||
item.udpConn.Close()
|
||||
s.udpConns.Remove(srcAddr)
|
||||
(*inConn).Close()
|
||||
}
|
||||
@ -252,8 +252,8 @@ func (s *TCP) OutToUDP(inConn *net.Conn) (err error) {
|
||||
} else {
|
||||
item = v.(*UDPConnItem)
|
||||
}
|
||||
(*item).touchtime = time.Now().Unix()
|
||||
go (*item).udpConn.Write(body)
|
||||
item.touchtime = time.Now().Unix()
|
||||
go item.udpConn.Write(body)
|
||||
}
|
||||
}
|
||||
func (s *TCP) UDPRevecive(key string) {
|
||||
|
||||
Reference in New Issue
Block a user