Skip to content
This repository was archived by the owner on Apr 17, 2019. It is now read-only.

Commit 8d5c3d2

Browse files
committed
bump dependencies;
minor changes
1 parent dbc255a commit 8d5c3d2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+6935
-3459
lines changed

Gopkg.lock

Lines changed: 19 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727

2828
[[constraint]]
2929
name = "github.com/jackc/pgx"
30-
branch = "master"
30+
version = "3.3.0"
3131

3232
[[constraint]]
3333
name = "github.com/prometheus/client_golang"
34-
version = "0.8.0"
34+
version = "0.9.2"
3535

3636
[[constraint]]
3737
name = "gopkg.in/yaml.v2"

pkg/config/config.go

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ var (
3232
}
3333
)
3434

35-
// ConfigInterface describes Config methods
36-
type ConfigInterface interface {
35+
// Interface describes Config methods
36+
type Interface interface {
3737
Load() error
3838
DbList() []string
3939
Db(string) DbConfig
@@ -113,7 +113,10 @@ func (v *VerSQLs) UnmarshalYAML(unmarshal func(interface{}) error) error {
113113
// UnmarshalYAML unmarshals the yaml
114114
func (c *ColumnUsage) UnmarshalYAML(unmarshal func(interface{}) error) error {
115115
var value string
116-
unmarshal(&value)
116+
if err := unmarshal(&value); err != nil {
117+
return err
118+
}
119+
117120
cu, ok := columnUsageMapping[value]
118121
if !ok {
119122
return fmt.Errorf("unknown usage: %v", value)
@@ -182,28 +185,29 @@ func (v VerSQLs) Query(version PgVersion) string {
182185
}
183186

184187
func ParseVersion(str string) PgVersion {
185-
var res = int(NoVersion)
186188
matches := pgVerRegex.FindStringSubmatch(str)
187189
if matches == nil {
188-
return PgVersion(res)
190+
return NoVersion
189191
}
192+
193+
ver := 0
190194
if matches[1] != "" {
191195
val, _ := strconv.Atoi(matches[1])
192-
res = val * 10000
196+
ver = val * 10000
193197
if val > 9 && matches[2] != "" {
194198
val, _ := strconv.Atoi(matches[2])
195-
res += val
199+
ver += val
196200
} else if matches[2] != "" {
197201
val, _ := strconv.Atoi(matches[2])
198-
res += val * 100
202+
ver += val * 100
199203
if matches[3] != "" {
200204
val, _ := strconv.Atoi(matches[3])
201-
res += val
205+
ver += val
202206
}
203207
}
204208
}
205209

206-
return PgVersion(res)
210+
return PgVersion(ver)
207211
}
208212

209213
func parseVersionRange(str string) (PgVersion, PgVersion) {

pkg/pgcollector/pgcollector.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var internalMetricsDescriptions = map[string]string{
2929
// PgCollector describes PostgreSQL metrics collector
3030
type PgCollector struct {
3131
sync.Mutex
32-
config config.ConfigInterface
32+
config config.Interface
3333
timeOuts uint32
3434
errors uint32
3535
}

vendor/github.com/golang/protobuf/LICENSE

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/golang/protobuf/proto/decode.go

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/golang/protobuf/proto/deprecated.go

Lines changed: 63 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/golang/protobuf/proto/encode.go

Lines changed: 0 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/golang/protobuf/proto/equal.go

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)