mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-08-13 14:17:54 +00:00
👕 Remove getFieldsWithReadonlyTag
method to fix the linter error
This commit is contained in:
parent
86b1289c5d
commit
872e4961dd
@ -1,25 +0,0 @@
|
|||||||
package config_test
|
|
||||||
|
|
||||||
import (
|
|
||||||
"reflect"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/kubeshark/kubeshark/config"
|
|
||||||
)
|
|
||||||
|
|
||||||
func getFieldsWithReadonlyTag(currentElem reflect.Value, readonlyFields *[]string) {
|
|
||||||
for i := 0; i < currentElem.NumField(); i++ {
|
|
||||||
currentField := currentElem.Type().Field(i)
|
|
||||||
currentFieldByName := currentElem.FieldByName(currentField.Name)
|
|
||||||
|
|
||||||
if currentField.Type.Kind() == reflect.Struct {
|
|
||||||
getFieldsWithReadonlyTag(currentFieldByName, readonlyFields)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if _, ok := currentField.Tag.Lookup(config.ReadonlyTag); ok {
|
|
||||||
fieldNameByTag := strings.Split(currentField.Tag.Get(config.FieldNameTag), ",")[0]
|
|
||||||
*readonlyFields = append(*readonlyFields, fieldNameByTag)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user