Skip to content

Instantly share code, notes, and snippets.

@ffalor
Created May 10, 2024 19:09
Show Gist options
  • Save ffalor/fb55af8bac245c113dd82b1ace7adf1d to your computer and use it in GitHub Desktop.
Save ffalor/fb55af8bac245c113dd82b1ace7adf1d to your computer and use it in GitHub Desktop.
var mlSliderLevels = []string{"DISABLED", "CAUTIOUS", "MODERATE", "AGGRESSIVE", "EXTRA_AGGRESSIVE"}
var mapMlSliderLevels = map[string]int{
"DISABLED": 0,
"CAUTIOUS": 1,
"MODERATE": 2,
"AGGRESSIVE": 3,
"EXTRA_AGGRESSIVE": 4,
}
detectionLevel := slider.Detection.String()
preventionLevel := slider.Prevention.String()
panic(
fmt.Sprintf(
"attr: %s detectionLevel: %s %d, preventionLevel: %s %d",
attribute,
detectionLevel,
mapMlSliderLevels[detectionLevel],
preventionLevel,
mapMlSliderLevels[preventionLevel],
),
)
panic: attr: cloud_anti_malware_microsoft_office_files detectionLevel: "CAUTIOUS" 0, preventionLevel: "MODERATE" 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment