Skip to content

Commit d61fb3f

Browse files
authored
docs: fix typos and godoc example indentation in timer.go and wrap.go (#2009)
Signed-off-by: Immanuel Tikhonov <pchpr.00@list.ru> Signed-off-by: immanuwell <pchpr.00@list.ru>
1 parent c9d5bc4 commit d61fb3f

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

prometheus/timer.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ type Timer struct {
3737
// or
3838
//
3939
// func TimeMeWithExemplar() {
40-
// timer := NewTimer(myHistogram)
41-
// defer timer.ObserveDurationWithExemplar(exemplar)
42-
// // Do actual work.
43-
// }
40+
// timer := NewTimer(myHistogram)
41+
// defer timer.ObserveDurationWithExemplar(exemplar)
42+
// // Do actual work.
43+
// }
4444
func NewTimer(o Observer) *Timer {
4545
return &Timer{
4646
begin: time.Now(),
@@ -66,7 +66,7 @@ func (t *Timer) ObserveDuration() time.Duration {
6666

6767
// ObserveDurationWithExemplar is like ObserveDuration, but it will also
6868
// observe exemplar with the duration unless exemplar is nil or provided Observer can't
69-
// be casted to ExemplarObserver.
69+
// be cast to ExemplarObserver.
7070
func (t *Timer) ObserveDurationWithExemplar(exemplar Labels) time.Duration {
7171
d := time.Since(t.begin)
7272
eo, ok := t.observer.(ExemplarObserver)

prometheus/wrap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ func wrapDesc(desc *Desc, prefix string, labels Labels) *Desc {
240240
}
241241
// NewDesc will do remaining validations.
242242
newDesc := V2.NewDesc(prefix+desc.fqName, desc.help, desc.variableLabels, constLabels, WithUnit(desc.unit))
243-
// Propagate errors if there was any. This will override any errer
243+
// Propagate errors if there was any. This will override any error
244244
// created by NewDesc above, i.e. earlier errors get precedence.
245245
if desc.err != nil {
246246
newDesc.err = desc.err

0 commit comments

Comments
 (0)