Skip to content

Commit

Permalink
all: imp code
Browse files Browse the repository at this point in the history
  • Loading branch information
schzhn committed Dec 26, 2024
1 parent 5a4b52b commit 8f9d0a4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions internal/cmd/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ func createProxyConfig(

hosts, err := handler.ReadHosts(hostsFiles)
if err != nil {
// Don't wrap the error since it's informative enough as is.
return nil, err
return nil, fmt.Errorf("reading hosts files: %w", err)
}

reqHdlr := handler.NewDefault(&handler.DefaultConfig{
Expand Down
2 changes: 0 additions & 2 deletions internal/handler/default.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Package handler provides some customizable DNS request handling logic used in
// the proxy.
package handler

import (
Expand Down
3 changes: 3 additions & 0 deletions internal/handler/handler.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Package handler provides some customizable DNS request handling logic used in
// the proxy.
package handler
1 change: 1 addition & 0 deletions internal/handler/hosts.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func readHostsFile(strg *hostsfile.DefaultStorage, path string) (err error) {
// #nosec G304 -- Trust the file path from the configuration file.
f, err := os.Open(path)
if err != nil {
// Don't wrap the error since it's informative enough as is.
return err
}

Expand Down

0 comments on commit 8f9d0a4

Please sign in to comment.