refactor: reformat

This commit is contained in:
xvzc 2022-11-29 16:54:28 +09:00
parent 195a68b26c
commit b552e77cbe
9 changed files with 155 additions and 156 deletions

View File

@ -5,6 +5,7 @@ import (
"sync"
"regexp"
"github.com/babolivier/go-doh-client"
)
@ -22,7 +23,6 @@ func Lookup(domain string) (string, error) {
return domain, nil
}
a, _, err := resolver.LookupA(domain)
if err != nil {
return "", err

View File

@ -45,17 +45,17 @@ func (c *Conn) Write(b []byte) (n int, err error) {
return c.conn.Write(b)
}
func (c *Conn) SetReadDeadline(t time.Time) (error) {
func (c *Conn) SetReadDeadline(t time.Time) error {
c.conn.SetReadDeadline(t)
return nil
}
func (c *Conn) SetDeadLine(t time.Time) (error) {
func (c *Conn) SetDeadLine(t time.Time) error {
c.conn.SetDeadline(t)
return nil
}
func (c *Conn) SetKeepAlive(b bool) (error) {
func (c *Conn) SetKeepAlive(b bool) error {
c.conn.SetKeepAlive(b)
return nil
}

View File

@ -8,8 +8,7 @@ type TCPAddr struct {
Addr *net.TCPAddr
}
func TcpAddr(ip string, port int) (*TCPAddr) {
func TcpAddr(ip string, port int) *TCPAddr {
addr := &net.TCPAddr{
IP: net.ParseIP(ip),
Port: port,