Jelajahi Sumber

Fix infinite loop in DuplicateMetric.Error

`%s` in fmt calls .Error(), so this was infinite looping.
Wade Simmons 11 tahun lalu
induk
melakukan
f51a76fc35
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      registry.go

+ 1 - 1
registry.go

@@ -12,7 +12,7 @@ import (
 type DuplicateMetric string
 
 func (err DuplicateMetric) Error() string {
-	return fmt.Sprintf("duplicate metric: %s", err)
+	return fmt.Sprintf("duplicate metric: %s", string(err))
 }
 
 // A Registry holds references to a set of metrics by name and can iterate