mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-24 17:04:42 +01:00
refactor: Remove unnecessary logs
This commit is contained in:
parent
dfcea93080
commit
be0962112e
@ -161,12 +161,10 @@ func (config Config) GetAlertingProviderByAlertType(alertType alert.Type) provid
|
|||||||
// SetAlertingProviderToNil Sets an alerting provider to nil to avoid having to revalidate it every time an
|
// SetAlertingProviderToNil Sets an alerting provider to nil to avoid having to revalidate it every time an
|
||||||
// alert of its corresponding type is sent.
|
// alert of its corresponding type is sent.
|
||||||
func (config *Config) SetAlertingProviderToNil(p provider.AlertProvider) {
|
func (config *Config) SetAlertingProviderToNil(p provider.AlertProvider) {
|
||||||
fmt.Println(config.GitHub)
|
|
||||||
entityType := reflect.TypeOf(config).Elem()
|
entityType := reflect.TypeOf(config).Elem()
|
||||||
for i := 0; i < entityType.NumField(); i++ {
|
for i := 0; i < entityType.NumField(); i++ {
|
||||||
field := entityType.Field(i)
|
field := entityType.Field(i)
|
||||||
if field.Type == reflect.TypeOf(p) {
|
if field.Type == reflect.TypeOf(p) {
|
||||||
fmt.Println("Setting", field.Name, "to nil")
|
|
||||||
reflect.ValueOf(config).Elem().Field(i).Set(reflect.Zero(field.Type))
|
reflect.ValueOf(config).Elem().Field(i).Set(reflect.Zero(field.Type))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user