From 970ef41bb68be7c3256c3f5f1670094f547ca36b Mon Sep 17 00:00:00 2001 From: zhulongcheng Date: Tue, 10 Sep 2019 21:45:09 +0800 Subject: [PATCH] Fix exported function comments (#6002) Signed-off-by: zhulongcheng --- pkg/gate/gate.go | 2 +- pkg/textparse/openmetricsparse.go | 2 +- pkg/textparse/promparse.go | 2 +- util/httputil/cors.go | 2 +- util/stats/query_stats.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/gate/gate.go b/pkg/gate/gate.go index 3d4fddb75b..6cb9d583c6 100644 --- a/pkg/gate/gate.go +++ b/pkg/gate/gate.go @@ -20,7 +20,7 @@ type Gate struct { ch chan struct{} } -// NewGate returns a query gate that limits the number of queries +// New returns a query gate that limits the number of queries // being concurrently executed. func New(length int) *Gate { return &Gate{ diff --git a/pkg/textparse/openmetricsparse.go b/pkg/textparse/openmetricsparse.go index 708ae5dd9a..ed76bc3957 100644 --- a/pkg/textparse/openmetricsparse.go +++ b/pkg/textparse/openmetricsparse.go @@ -87,7 +87,7 @@ type OpenMetricsParser struct { offsets []int } -// New returns a new parser of the byte slice. +// NewOpenMetricsParser returns a new parser of the byte slice. func NewOpenMetricsParser(b []byte) Parser { return &OpenMetricsParser{l: &openMetricsLexer{b: b}} } diff --git a/pkg/textparse/promparse.go b/pkg/textparse/promparse.go index 2ecb04bfff..69fa51c3dd 100644 --- a/pkg/textparse/promparse.go +++ b/pkg/textparse/promparse.go @@ -153,7 +153,7 @@ type PromParser struct { offsets []int } -// New returns a new parser of the byte slice. +// NewPromParser returns a new parser of the byte slice. func NewPromParser(b []byte) Parser { return &PromParser{l: &promlexer{b: append(b, '\n')}} } diff --git a/util/httputil/cors.go b/util/httputil/cors.go index fdd5d3cd2c..c8bdb3ac35 100644 --- a/util/httputil/cors.go +++ b/util/httputil/cors.go @@ -25,7 +25,7 @@ var corsHeaders = map[string]string{ "Vary": "Origin", } -// Enables cross-site script calls. +// SetCORS enables cross-site script calls. func SetCORS(w http.ResponseWriter, o *regexp.Regexp, r *http.Request) { origin := r.Header.Get("Origin") if origin == "" { diff --git a/util/stats/query_stats.go b/util/stats/query_stats.go index 181bdde3b9..3fea3921fa 100644 --- a/util/stats/query_stats.go +++ b/util/stats/query_stats.go @@ -54,7 +54,7 @@ func (s QueryTiming) String() string { } } -// Return a string representation of a QueryTiming span operation. +// SpanOperation returns a string representation of a QueryTiming span operation. func (s QueryTiming) SpanOperation() string { switch s { case EvalTotalTime: