Skip to content

Commit 42c8df2

Browse files
javaduckycodebien
authored andcommitted
Address linter issues when applying CI
Fixes #19 Signed-off-by: Paul Balogh <javaducky@gmail.com>
1 parent fdd6fb8 commit 42c8df2

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

pkg/influxdb/config.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"gopkg.in/guregu/null.v3"
1212
)
1313

14+
// Config contains the configuration for the Output.
1415
type Config struct {
1516
Addr null.String `json:"addr" envconfig:"K6_INFLUXDB_ADDR"`
1617
Organization null.String `json:"organization" envconfig:"K6_INFLUXDB_ORGANIZATION"`
@@ -34,6 +35,7 @@ func NewConfig() Config {
3435
return c
3536
}
3637

38+
// Apply overrides internal configuration with received values.
3739
func (c Config) Apply(cfg Config) Config {
3840
if cfg.Addr.Valid {
3941
c.Addr = cfg.Addr
@@ -91,7 +93,8 @@ func parseURL(text string) (Config, error) {
9193
// GetConsolidatedConfig combines {default config values + JSON config +
9294
// environment vars + URL config values}, and returns the final result.
9395
func GetConsolidatedConfig(
94-
jsonRawConf json.RawMessage, env map[string]string, url string) (Config, error) {
96+
jsonRawConf json.RawMessage, env map[string]string, url string,
97+
) (Config, error) {
9598
result := NewConfig()
9699
if jsonRawConf != nil {
97100
jsonConf, err := parseJSON(jsonRawConf)

pkg/influxdb/output.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package influxdb is a k6 output that sends metrics to an InfluxDB v2 database.
12
package influxdb
23

34
import (
@@ -27,9 +28,13 @@ func init() {
2728
type FieldKind int
2829

2930
const (
31+
// String denotes string datatype
3032
String FieldKind = iota
33+
// Int denotes integer datatype
3134
Int
35+
// Float denotes float datatype
3236
Float
37+
// Bool denotes a boolean datatype
3338
Bool
3439
)
3540

@@ -208,7 +213,9 @@ func (o *Output) flushMetrics() {
208213
d := time.Since(start)
209214
o.logger.WithField("elapsed", d).Debug("Metrics points have been sent")
210215
if d > time.Duration(o.config.PushInterval.Duration) {
211-
msg := "The flush operation took higher than the expected set push interval. If you see this message multiple times then the setup or configuration need to be adjusted to achieve a sustainable rate."
216+
msg := "The flush operation took higher than the expected set push interval. " +
217+
"If you see this message multiple times then the setup or configuration " +
218+
"need to be adjusted to achieve a sustainable rate."
212219
o.logger.WithField("t", d).Warn(msg)
213220
}
214221
}()

register.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package influxdb registers the xk6-influxdb extension
12
package influxdb
23

34
import (

0 commit comments

Comments
 (0)