Trivial spelling corrections and a small comment.

This commit is contained in:
Dominik Schulz 2016-10-18 20:14:38 +02:00
parent 630b96c5f3
commit 182e17958a
4 changed files with 5 additions and 2 deletions

View File

@ -910,6 +910,7 @@ type EC2SDConfig struct {
SecretKey string `yaml:"secret_key,omitempty"`
RefreshInterval model.Duration `yaml:"refresh_interval,omitempty"`
Port int `yaml:"port"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}
@ -939,6 +940,7 @@ type AzureSDConfig struct {
ClientID string `yaml:"client_id,omitempty"`
ClientSecret string `yaml:"client_secret,omitempty"`
RefreshInterval model.Duration `yaml:"refresh_interval,omitempty"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}

View File

@ -362,7 +362,7 @@ func TestLoadConfig(t *testing.T) {
// Parse a valid file that sets a global scrape timeout. This tests whether parsing
// an overwritten default field in the global config permanently changes the default.
if _, err := LoadFile("testdata/global_timeout.good.yml"); err != nil {
t.Errorf("Error parsing %s: %s", "testdata/conf.good.yml", err)
t.Errorf("Error parsing %s: %s", "testdata/global_timeout.good.yml", err)
}
c, err := LoadFile("testdata/conf.good.yml")

View File

@ -290,6 +290,7 @@ func (n *Notifier) sendAll(alerts ...*model.Alert) int {
}
defer resp.Body.Close()
// Any HTTP status 2xx is OK.
if resp.StatusCode/100 != 2 {
return fmt.Errorf("bad response status %v", resp.Status)
}

View File

@ -518,7 +518,7 @@ func (c *varbitChunk) addSecondSample(s model.SamplePair) ([]Chunk, error) {
return []Chunk{c}, nil
}
// addLastSample isa a helper method only used by c.add() and in other helper
// addLastSample is a helper method only used by c.add() and in other helper
// methods called by c.add(). It simply sets the given sample as the last sample
// in the heador and declares the chunk closed. In other words, addLastSample
// adds the very last sample added to this chunk ever, while setLastSample sets