in main/handlersettings.go [122:138]
func (v *vmWatchSettings) TryGetVMWatchCohortId() (vmWatchCohortId string, err error) {
if v.EnvironmentAttributes == nil {
return "", nil
}
var bytes []byte
if bytes, err = json.Marshal(v.EnvironmentAttributes); err != nil {
return "", errors.Wrap(err, "failed to marshal environment attributes")
}
var envAttributes environmentAttributes
if err := json.Unmarshal(bytes, &envAttributes); err != nil {
return "", errors.Wrap(err, "failed to unmarshal environment attributes")
}
return envAttributes.VMWatchCohortId, nil
}