Selaa lähdekoodia

[fixes #188] expose a constructor for SampleSnapshot

mihasya 9 vuotta sitten
vanhempi
commit
22d219e7f2
1 muutettua tiedostoa jossa 7 lisäystä ja 0 poistoa
  1. 7 0
      sample.go

+ 7 - 0
sample.go

@@ -302,6 +302,13 @@ type SampleSnapshot struct {
 	values []int64
 }
 
+func NewSampleSnapshot(count int64, values []int64) *SampleSnapshot {
+	return &SampleSnapshot{
+		count:  count,
+		values: values,
+	}
+}
+
 // Clear panics.
 func (*SampleSnapshot) Clear() {
 	panic("Clear called on a SampleSnapshot")