From a033a68d9f5fcdaea840884de05a3b5fe37dfeab Mon Sep 17 00:00:00 2001 From: Jens Erat Date: Wed, 16 Dec 2020 21:53:31 +0100 Subject: [PATCH] Properly initialize nested struct in influxdb test If actually running the influxdb tests (not included in Makefile), a compiler error occured ("cannot use promoted field in struct literal of type") because direct access to promoted fields is only allowed in assignments, not when initializing structs (at least, unless golang/go#9859 gets implemented). Signed-off-by: Jens Erat --- cmd/internal/storage/influxdb/influxdb_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/internal/storage/influxdb/influxdb_test.go b/cmd/internal/storage/influxdb/influxdb_test.go index 9e8a58f943..0e841584b4 100644 --- a/cmd/internal/storage/influxdb/influxdb_test.go +++ b/cmd/internal/storage/influxdb/influxdb_test.go @@ -360,7 +360,7 @@ func createTestStats() (*info.ContainerInfo, *info.ContainerStats) { "2GB": {Usage: 9876, MaxUsage: 5432, Failcnt: 1}, }, ReferencedMemory: 12345, - PerfStats: []info.PerfStat{{Cpu: 1, Name: "cycles", ScalingRatio: 1.5, Value: 4589}}, + PerfStats: []info.PerfStat{{Cpu: 1, PerfValue: info.PerfValue{Name: "cycles", ScalingRatio: 1.5, Value: 4589}}}, Resctrl: info.ResctrlStats{ MemoryBandwidth: []info.MemoryBandwidthStats{ {TotalBytes: 11234, LocalBytes: 4567},