mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-09 08:01:31 +00:00
all: use reflect.TypeFor now available in Go 1.22 (#11078)
Updates #cleanup Signed-off-by: Joe Tsai <joetsai@digital-static.net>
This commit is contained in:
@@ -802,7 +802,7 @@ func TestPrefFlagMapping(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
prefType := reflect.TypeOf(ipn.Prefs{})
|
||||
prefType := reflect.TypeFor[ipn.Prefs]()
|
||||
for i := 0; i < prefType.NumField(); i++ {
|
||||
prefName := prefType.Field(i).Name
|
||||
if prefHasFlag[prefName] {
|
||||
|
@@ -726,7 +726,7 @@ func init() {
|
||||
|
||||
func addPrefFlagMapping(flagName string, prefNames ...string) {
|
||||
prefsOfFlag[flagName] = prefNames
|
||||
prefType := reflect.TypeOf(ipn.Prefs{})
|
||||
prefType := reflect.TypeFor[ipn.Prefs]()
|
||||
for _, pref := range prefNames {
|
||||
t := prefType
|
||||
for _, name := range strings.Split(pref, ".") {
|
||||
|
Reference in New Issue
Block a user