Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pellared committed Nov 15, 2023
1 parent 2f36c24 commit af08f24
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ func NewHTTPCollector(endpoint string, resultCh <-chan ExportResult, opts ...fun
return c, nil
}

// WithHTTPCollectorRespondingPlainText makes the HTTPCollector to return a
// plaintext, instead of protobuf, response.
// WithHTTPCollectorRespondingPlainText makes the HTTPCollector return
// a plaintext, instead of protobuf, response.
func WithHTTPCollectorRespondingPlainText() func(*HTTPCollector) {
return func(s *HTTPCollector) {
s.plainTextResponse = true
Expand Down Expand Up @@ -398,7 +398,7 @@ func (c *HTTPCollector) respond(w http.ResponseWriter, resp ExportResult) {
if c.plainTextResponse {
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
w.WriteHeader(http.StatusOK)
_, _ = io.WriteString(w, "OK")
_, _ = w.Write([]byte("OK"))
return
}

Check warning on line 403 in exporters/otlp/otlpmetric/otlpmetricgrpc/internal/otest/collector.go

View check run for this annotation

Codecov / codecov/patch

exporters/otlp/otlpmetric/otlpmetricgrpc/internal/otest/collector.go#L398-L403

Added lines #L398 - L403 were not covered by tests

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ func NewHTTPCollector(endpoint string, resultCh <-chan ExportResult, opts ...fun
return c, nil
}

// WithHTTPCollectorRespondingPlainText makes the HTTPCollector to return a
// plaintext, instead of protobuf, response.
// WithHTTPCollectorRespondingPlainText makes the HTTPCollector return
// a plaintext, instead of protobuf, response.
func WithHTTPCollectorRespondingPlainText() func(*HTTPCollector) {
return func(s *HTTPCollector) {
s.plainTextResponse = true
Expand Down Expand Up @@ -398,7 +398,7 @@ func (c *HTTPCollector) respond(w http.ResponseWriter, resp ExportResult) {
if c.plainTextResponse {
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
w.WriteHeader(http.StatusOK)
_, _ = io.WriteString(w, "OK")
_, _ = w.Write([]byte("OK"))
return
}

Expand Down
6 changes: 3 additions & 3 deletions internal/shared/otlp/otlpmetric/otest/collector.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ func NewHTTPCollector(endpoint string, resultCh <-chan ExportResult, opts ...fun
return c, nil
}

// WithHTTPCollectorRespondingPlainText makes the HTTPCollector to return a
// plaintext, instead of protobuf, response.
// WithHTTPCollectorRespondingPlainText makes the HTTPCollector return
// a plaintext, instead of protobuf, response.
func WithHTTPCollectorRespondingPlainText() func(*HTTPCollector) {
return func(s *HTTPCollector) {
s.plainTextResponse = true
Expand Down Expand Up @@ -398,7 +398,7 @@ func (c *HTTPCollector) respond(w http.ResponseWriter, resp ExportResult) {
if c.plainTextResponse {
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
w.WriteHeader(http.StatusOK)
_, _ = io.WriteString(w, "OK")
_, _ = w.Write([]byte("OK"))
return
}

Expand Down

0 comments on commit af08f24

Please sign in to comment.