Fix typos and import order.

This doesn't make the import order consistend everywhere, just where
it was touched by the previous commit.

Change-Id: I82fc75f8691da9901c7ceb808e6f6fe8e5d62c0e
This commit is contained in:
Bjoern Rabenstein 2014-12-10 17:46:56 +01:00
parent b1e4956142
commit 39efe6358b
5 changed files with 8 additions and 6 deletions

View file

@ -17,13 +17,14 @@ import (
"fmt" "fmt"
"regexp" "regexp"
"time" "time"
"code.google.com/p/goprotobuf/proto" "code.google.com/p/goprotobuf/proto"
clientmodel "github.com/prometheus/client_golang/model" clientmodel "github.com/prometheus/client_golang/model"
pb "github.com/prometheus/prometheus/config/generated"
"github.com/prometheus/prometheus/utility" "github.com/prometheus/prometheus/utility"
pb "github.com/prometheus/prometheus/config/generated"
) )
var jobNameRE = regexp.MustCompile("^[a-zA-Z_][a-zA-Z0-9_-]*$") var jobNameRE = regexp.MustCompile("^[a-zA-Z_][a-zA-Z0-9_-]*$")

View file

@ -17,6 +17,7 @@ import (
"io/ioutil" "io/ioutil"
"code.google.com/p/goprotobuf/proto" "code.google.com/p/goprotobuf/proto"
pb "github.com/prometheus/prometheus/config/generated" pb "github.com/prometheus/prometheus/config/generated"
) )
@ -41,7 +42,7 @@ func LoadFromString(configStr string) (Config, error) {
return config, err return config, err
} }
// LoadFromFile returns a config parsed from the file of teh provided name. // LoadFromFile returns a config parsed from the file of the provided name.
func LoadFromFile(fileName string) (Config, error) { func LoadFromFile(fileName string) (Config, error) {
configStr, err := ioutil.ReadFile(fileName) configStr, err := ioutil.ReadFile(fileName)
if err != nil { if err != nil {

View file

@ -51,7 +51,7 @@ func DurationToString(duration time.Duration) string {
} }
// StringToDuration parses a string into a time.Duration, assuming that a year // StringToDuration parses a string into a time.Duration, assuming that a year
// always has 265d, a week 7d, a day 24h. See DurationToString for problems with // always has 365d, a week 7d, a day 24h. See DurationToString for problems with
// that. // that.
func StringToDuration(durationStr string) (duration time.Duration, err error) { func StringToDuration(durationStr string) (duration time.Duration, err error) {
matches := durationRE.FindStringSubmatch(durationStr) matches := durationRE.FindStringSubmatch(durationStr)

View file

@ -149,7 +149,7 @@ func (serv MetricsService) QueryRange(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, result) fmt.Fprint(w, result)
} }
// Metrics handles the /api/metrics endpaint. // Metrics handles the /api/metrics endpoint.
func (serv MetricsService) Metrics(w http.ResponseWriter, r *http.Request) { func (serv MetricsService) Metrics(w http.ResponseWriter, r *http.Request) {
setAccessControlHeaders(w) setAccessControlHeaders(w)

View file

@ -23,7 +23,7 @@ import (
"github.com/prometheus/prometheus/web/httputils" "github.com/prometheus/prometheus/web/httputils"
) )
// TargetGroup bundles endpaints and base labels with appropriate JSON // TargetGroup bundles endpoints and base labels with appropriate JSON
// annotations. // annotations.
type TargetGroup struct { type TargetGroup struct {
Endpoints []string `json:"endpoints"` Endpoints []string `json:"endpoints"`