Skip to content

Commit

Permalink
make golint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
attilaolah committed Jan 25, 2015
1 parent 6ef1507 commit e751f51
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
9 changes: 3 additions & 6 deletions cmd/dnsp/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,14 @@ import (
"github.com/gophergala/dnsp"
)

var (
Version = "0.0.0"

DefaultResolve = "8.8.4.4,8.8.8.8"
)
// DefaultResolve is the default list of nameservers for the `--resolve` flag.
var DefaultResolve = "8.8.4.4,8.8.8.8"

func main() {
app := cli.NewApp()
app.Name = "dnsp"
app.Usage = "DNS proxy with whitelist/blacklist support"
app.Version = Version
app.Version = "0.0.0"
app.Author, app.Email = "", ""
app.Flags = []cli.Flag{
cli.StringFlag{
Expand Down
3 changes: 3 additions & 0 deletions hosts_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,20 @@ import (
"strings"
)

// HostsReader reads host entries from a file.
type HostsReader struct {
Reader io.Reader
}

// NewHostsReader creates a HostReader from any io.Reader.
func NewHostsReader(r io.Reader) *HostsReader {
return &HostsReader{Reader: r}
}

// HostsReaderFunc is a function that takes a hostname as its first argument.
type HostsReaderFunc func(string)

// ReadFunc reads the data line-by-line, feading each host entry to fn.
func (h *HostsReader) ReadFunc(fn HostsReaderFunc) {
scanner := bufio.NewScanner(h.Reader)
for scanner.Scan() {
Expand Down
1 change: 1 addition & 0 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ type Options struct {
Blacklist string
}

// Validate verifies that the options are correct.
func (o *Options) Validate() error {
if o.Net == "" {
o.Net = "udp"
Expand Down
2 changes: 1 addition & 1 deletion wercker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ build:
- script:
name: golint
code: |
golint -min_confidence=1 .
golint .
1 change: 1 addition & 0 deletions whitelist.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/miekg/dns"
)

// Host flags used in the whitelist/blacklist map.
const (
Unknown host = iota
White // whitelisted
Expand Down

0 comments on commit e751f51

Please sign in to comment.