Skip to content

Commit c9e35bb

Browse files
committed
fix localnameserver creation
1 parent 6982078 commit c9e35bb

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

app/dns/nameserver.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ type NameServer interface {
1010
QueryIP(ctx context.Context, domain string) ([]net.IP, error)
1111
}
1212

13-
type LocalNameServer struct {
13+
type localNameServer struct {
1414
resolver net.Resolver
1515
}
1616

17-
func (s *LocalNameServer) QueryIP(ctx context.Context, domain string) ([]net.IP, error) {
17+
func (s *localNameServer) QueryIP(ctx context.Context, domain string) ([]net.IP, error) {
1818
ipAddr, err := s.resolver.LookupIPAddr(ctx, domain)
1919
if err != nil {
2020
return nil, err
@@ -26,8 +26,8 @@ func (s *LocalNameServer) QueryIP(ctx context.Context, domain string) ([]net.IP,
2626
return ips, nil
2727
}
2828

29-
func NewLocalNameServer() *LocalNameServer {
30-
return &LocalNameServer{
29+
func NewLocalNameServer() *localNameServer {
30+
return &localNameServer{
3131
resolver: net.Resolver{
3232
PreferGo: true,
3333
},

app/dns/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func New(ctx context.Context, config *Config) (*Server, error) {
4444
for idx, destPB := range config.NameServers {
4545
address := destPB.Address.AsAddress()
4646
if address.Family().IsDomain() && address.Domain() == "localhost" {
47-
server.servers[idx] = &LocalNameServer{}
47+
server.servers[idx] = NewLocalNameServer()
4848
} else {
4949
dest := destPB.AsDestination()
5050
if dest.Network == net.Network_Unknown {
@@ -56,7 +56,7 @@ func New(ctx context.Context, config *Config) (*Server, error) {
5656
}
5757
}
5858
if len(config.NameServers) == 0 {
59-
server.servers = append(server.servers, &LocalNameServer{})
59+
server.servers = append(server.servers, NewLocalNameServer())
6060
}
6161

6262
return server, nil

vendor/websocket

0 commit comments

Comments
 (0)