mirror of
https://github.com/FairwindsOps/polaris.git
synced 2026-05-21 00:24:13 +00:00
remove unused code
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
)
|
||||
|
||||
// GetIDFromField returns the JSON key associated with a particular field, which serves as the check ID.
|
||||
func GetIDFromField(config interface{}, name string) string {
|
||||
t := reflect.TypeOf(config)
|
||||
field, ok := t.FieldByName(name)
|
||||
if !ok {
|
||||
panic("No JSON annotation for field " + name)
|
||||
}
|
||||
id, ok := field.Tag.Lookup("json")
|
||||
if !ok {
|
||||
panic("No JSON tag for field " + name)
|
||||
}
|
||||
return id
|
||||
}
|
||||
Reference in New Issue
Block a user