diff --git a/README.md b/README.md index 2b6eb2683..575673ff7 100644 --- a/README.md +++ b/README.md @@ -159,13 +159,12 @@ i.e. no grouping by tag. [embedmd]:# (stats.go view) ```go -err = view.Subscribe(&view.View{ +if err = view.Subscribe(&view.View{ Name: "my.org/video_size_distribution", Description: "distribution of processed video size over time", Measure: videoSize, - Aggregation: view.DistributionAggregation{0, 1 << 32, 2 << 32, 3 << 32}, -}) -if err != nil { + Aggregation: view.DistributionAggregation([]float64{0, 1 << 32, 2 << 32, 3 << 32}), +}); err != nil { log.Fatalf("Failed to subscribe to view: %v", err) } ``` diff --git a/internal/readme/stats.go b/internal/readme/stats.go index c5d55c249..494968d88 100644 --- a/internal/readme/stats.go +++ b/internal/readme/stats.go @@ -57,13 +57,12 @@ func statsExamples() { _, _, _, _ = distAgg, countAgg, sumAgg, meanAgg // START view - err = view.Subscribe(&view.View{ + if err = view.Subscribe(&view.View{ Name: "my.org/video_size_distribution", Description: "distribution of processed video size over time", Measure: videoSize, - Aggregation: view.DistributionAggregation{0, 1 << 32, 2 << 32, 3 << 32}, - }) - if err != nil { + Aggregation: view.DistributionAggregation([]float64{0, 1 << 32, 2 << 32, 3 << 32}), + }); err != nil { log.Fatalf("Failed to subscribe to view: %v", err) } // END view