Skip to content

Commit

Permalink
upstream: imp code
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizzick committed Jul 4, 2024
1 parent eef7afb commit 8bc8e4d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions upstream/hostsresolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ func NewHostsResolver(hosts hostsfile.Storage) (hr *HostsResolver) {
// NewDefaultHostsResolver returns a resolver based on system hosts files
// provided by the [hostsfile.DefaultHostsPaths] and read from rootFSys. In
// case the file by any default path doesn't exist it adds a log debug record.
// If l is nil, [slog.Default] is used.
func NewDefaultHostsResolver(rootFSys fs.FS, l *slog.Logger) (hr *HostsResolver, err error) {
if l == nil {
l = slog.Default()
}

paths, err := hostsfile.DefaultHostsPaths()
if err != nil {
return nil, fmt.Errorf("getting default hosts paths: %w", err)
Expand Down

0 comments on commit 8bc8e4d

Please # to comment.