Skip to content

Commit

Permalink
doc: some function/vars/const/package level updates (coredns#1558)
Browse files Browse the repository at this point in the history
* doc: some function/vars/const/package level updates

Various update that stood out while reading godoc.org for CoreDNS.

* Fix some misspellings as well
  • Loading branch information
miekg authored Feb 23, 2018
1 parent e3b7bea commit 455040c
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion core/dnsserver/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func normalizeZone(str string) (zoneAddr, error) {
return zoneAddr{Zone: dns.Fqdn(host), Port: port, Transport: trans, IPNet: ipnet}, nil
}

// SplitProtocolHostPort - split a full formed address like "dns://[::1}:53" into parts
// SplitProtocolHostPort splits a full formed address like "dns://[::1]:53" into parts.
func SplitProtocolHostPort(address string) (protocol string, ip string, port string, err error) {
parts := strings.Split(address, "://")
switch len(parts) {
Expand Down
4 changes: 3 additions & 1 deletion coremain/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,11 @@ var (
buildDate string // date -u
gitTag string // git describe --exact-match HEAD 2> /dev/null
gitNearestTag string // git describe --abbrev=0 --tags HEAD
GitCommit string // git rev-parse HEAD
gitShortStat string // git diff-index --shortstat
gitFilesModified string // git diff-index --name-only HEAD

// Gitcommit contains the commit where we built CoreDNS from.
GitCommit string
)

// flagsBlacklist removes flags with these names from our flagset.
Expand Down
2 changes: 1 addition & 1 deletion plugin/forward/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var (
Namespace: plugin.Namespace,
Subsystem: "forward",
Name: "socket_count_total",
Help: "Guage of open sockets per upstream.",
Help: "Gauge of open sockets per upstream.",
}, []string{"to"})
)

Expand Down
2 changes: 1 addition & 1 deletion plugin/forward/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func init() {
func setup(c *caddy.Controller) error {
f, err := parseForward(c)
if err != nil {
return plugin.Error("foward", err)
return plugin.Error("forward", err)
}
if f.Len() > max {
return plugin.Error("forward", fmt.Errorf("more than %d TOs configured: %d", max, f.Len()))
Expand Down
1 change: 1 addition & 0 deletions plugin/pkg/fuzz/do.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package fuzz contains functions that enable fuzzing of plugins.
package fuzz

import (
Expand Down
1 change: 1 addition & 0 deletions plugin/pkg/parse/parse.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package parse contains functions that can be used in the setup code for plugins.
package parse

import (
Expand Down
3 changes: 1 addition & 2 deletions plugin/pkg/rcode/rcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import (
"github.com/miekg/dns"
)

// ToString convert the rcode to the official DNS string, or to "RCODE"+value if the RCODE
// value is unknown.
// ToString convert the rcode to the official DNS string, or to "RCODE"+value if the RCODE value is unknown.
func ToString(rcode int) string {
if str, ok := dns.RcodeToString[rcode]; ok {
return str
Expand Down
2 changes: 2 additions & 0 deletions plugin/pkg/up/up.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package up is used to run a function for some duration. If a new function is added while a previous run is
// still ongoing, nothing new will be executed.
package up

import (
Expand Down
3 changes: 1 addition & 2 deletions request/request.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Package request abstracts a client's request so that all plugin
// will handle them in an unified way.
// Package request abstracts a client's request so that all plugins will handle them in an unified way.
package request

import (
Expand Down

0 comments on commit 455040c

Please sign in to comment.