From 182e17958ab53c9f27d4f01692d3abfd2e25de61 Mon Sep 17 00:00:00 2001 From: Dominik Schulz Date: Tue, 18 Oct 2016 20:14:38 +0200 Subject: [PATCH] Trivial spelling corrections and a small comment. --- config/config.go | 2 ++ config/config_test.go | 2 +- notifier/notifier.go | 1 + storage/local/chunk/varbit.go | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config/config.go b/config/config.go index a340e0fed..43fce96e9 100644 --- a/config/config.go +++ b/config/config.go @@ -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"` } diff --git a/config/config_test.go b/config/config_test.go index 17642f76c..af456e503 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -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") diff --git a/notifier/notifier.go b/notifier/notifier.go index a577e027e..8f37cc8a5 100644 --- a/notifier/notifier.go +++ b/notifier/notifier.go @@ -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) } diff --git a/storage/local/chunk/varbit.go b/storage/local/chunk/varbit.go index f9d135e73..42de4adb2 100644 --- a/storage/local/chunk/varbit.go +++ b/storage/local/chunk/varbit.go @@ -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