Skip to content

Commit 475aad0

Browse files
committed
[chore] [dorisexporter] fix lint error
See https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/12761302791/job/35568099940?pr=37187 > Error: dorisexporter/exporter_common.go:127:6: var-naming: func toJsonLines should be toJSONLines (revive) > func toJsonLines[T dLog | dTrace | metric](data []*T) ([]byte, error) {
1 parent 09d4ae3 commit 475aad0

9 files changed

+9
-9
lines changed

exporter/dorisexporter/exporter_common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ type metric interface {
124124
dMetricGauge | dMetricSum | dMetricHistogram | dMetricExponentialHistogram | dMetricSummary
125125
}
126126

127-
func toJsonLines[T dLog | dTrace | metric](data []*T) ([]byte, error) {
127+
func toJSONLines[T dLog | dTrace | metric](data []*T) ([]byte, error) {
128128
buf := &bytes.Buffer{}
129129
enc := json.NewEncoder(buf)
130130
for _, d := range data {

exporter/dorisexporter/exporter_common_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func findRandomPort() (int, error) {
6363
}
6464

6565
func TestToJsonLines(t *testing.T) {
66-
logs, err := toJsonLines([]*dLog{
66+
logs, err := toJSONLines([]*dLog{
6767
{}, {},
6868
})
6969
require.NoError(t, err)

exporter/dorisexporter/exporter_logs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func (e *logsExporter) pushLogData(ctx context.Context, ld plog.Logs) error {
122122
}
123123

124124
func (e *logsExporter) pushLogDataInternal(ctx context.Context, logs []*dLog) error {
125-
marshal, err := toJsonLines(logs)
125+
marshal, err := toJSONLines(logs)
126126
if err != nil {
127127
return err
128128
}

exporter/dorisexporter/exporter_traces.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ func (e *tracesExporter) pushTraceData(ctx context.Context, td ptrace.Traces) er
180180
}
181181

182182
func (e *tracesExporter) pushTraceDataInternal(ctx context.Context, traces []*dTrace) error {
183-
marshal, err := toJsonLines(traces)
183+
marshal, err := toJSONLines(traces)
184184
if err != nil {
185185
return err
186186
}

exporter/dorisexporter/metrics_exponential_histogram.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,5 @@ func (m *metricModelExponentialHistogram) size() int {
117117
}
118118

119119
func (m *metricModelExponentialHistogram) bytes() ([]byte, error) {
120-
return toJsonLines(m.data)
120+
return toJSONLines(m.data)
121121
}

exporter/dorisexporter/metrics_gauge.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,5 @@ func (m *metricModelGauge) size() int {
8383
}
8484

8585
func (m *metricModelGauge) bytes() ([]byte, error) {
86-
return toJsonLines(m.data)
86+
return toJSONLines(m.data)
8787
}

exporter/dorisexporter/metrics_histogram.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,5 +107,5 @@ func (m *metricModelHistogram) size() int {
107107
}
108108

109109
func (m *metricModelHistogram) bytes() ([]byte, error) {
110-
return toJsonLines(m.data)
110+
return toJSONLines(m.data)
111111
}

exporter/dorisexporter/metrics_sum.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,5 @@ func (m *metricModelSum) size() int {
8787
}
8888

8989
func (m *metricModelSum) bytes() ([]byte, error) {
90-
return toJsonLines(m.data)
90+
return toJSONLines(m.data)
9191
}

exporter/dorisexporter/metrics_summary.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,5 @@ func (m *metricModelSummary) size() int {
8888
}
8989

9090
func (m *metricModelSummary) bytes() ([]byte, error) {
91-
return toJsonLines(m.data)
91+
return toJSONLines(m.data)
9292
}

0 commit comments

Comments
 (0)