From 020b5519e7c89506472be8692b093bbc2964e0a5 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Thu, 16 Nov 2023 10:12:09 +0100 Subject: [PATCH] [core] Minor consistency fix --- core/integration/dcs/structs.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/core/integration/dcs/structs.go b/core/integration/dcs/structs.go index 938d6e2d..c79a2ab3 100644 --- a/core/integration/dcs/structs.go +++ b/core/integration/dcs/structs.go @@ -31,13 +31,19 @@ import ( dcspb "github.com/AliceO2Group/Control/core/integration/dcs/protos" ) -func (detectors DCSDetectors) ToStringSlice() []string { - ret := make([]string, len(detectors)) +func (d DCSDetectors) ToStringSlice() (sslice []string) { + if d == nil { + return + } + sslice = make([]string, len(d)) + if len(d) == 0 { + return + } - for i, det := range detectors { - ret[i] = det.String() + for i, det := range d { + sslice[i] = det.String() } - return ret + return } func (d DCSDetectors) EcsDetectorsSlice() (sslice []string) {