diff options
| author | Jeroen Wijenbergh <jeroen.wijenbergh@geant.org> | 2025-05-06 12:40:47 +0200 |
|---|---|---|
| committer | Jeroen Wijenbergh <jeroen.wijenbergh@geant.org> | 2025-05-06 12:40:47 +0200 |
| commit | 347b20fc91505584bc9efbeca89590a411b95e79 (patch) | |
| tree | 9dfc600e957c4a881115f8bc8a9cc107a4f0cc9c /cmd/eduvpn-cli | |
| parent | 9c4985368aee638d982f30ea7bc5c7ee71ae3ab3 (diff) | |
All: Run modernize --test --fix
Diffstat (limited to 'cmd/eduvpn-cli')
| -rw-r--r-- | cmd/eduvpn-cli/main.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cmd/eduvpn-cli/main.go b/cmd/eduvpn-cli/main.go index 2a990f2..2dd0c31 100644 --- a/cmd/eduvpn-cli/main.go +++ b/cmd/eduvpn-cli/main.go @@ -19,7 +19,7 @@ import ( ) // Open a browser with xdg-open. -func openBrowser(data interface{}) { +func openBrowser(data any) { str, ok := data.(string) if !ok { return @@ -33,7 +33,7 @@ func openBrowser(data interface{}) { }() } -func getProfileInteractive(profiles *srvtypes.Profiles, data interface{}) (string, error) { +func getProfileInteractive(profiles *srvtypes.Profiles, data any) (string, error) { fmt.Printf("Multiple VPN profiles found. Please select a profile by entering e.g. 1") ps := "" var options []string @@ -59,7 +59,7 @@ func getProfileInteractive(profiles *srvtypes.Profiles, data interface{}) (strin return p, nil } -func sendProfile(profile string, data interface{}) { +func sendProfile(profile string, data any) { d, ok := data.(*srvtypes.RequiredAskTransition) if !ok { fmt.Fprintf(os.Stderr, "\ninvalid data type: %v\n", reflect.TypeOf(data)) @@ -89,7 +89,7 @@ func sendProfile(profile string, data interface{}) { // If OAuth is started we open the browser with the Auth URL // If we ask for a profile, we send the profile using command line input // Note that this has an additional argument, the vpn state which was wrapped into this callback function below. -func stateCallback(_ client.FSMStateID, newState client.FSMStateID, data interface{}, prof string, dir string) { +func stateCallback(_ client.FSMStateID, newState client.FSMStateID, data any, prof string, dir string) { if newState == client.StateOAuthStarted { openBrowser(data) } @@ -150,7 +150,7 @@ func printConfig(url string, cc string, srvType srvtypes.Type, prof string, debu "org.eduvpn.app.linux", fmt.Sprintf("%s-cli", version.Version), dir, - func(oldState client.FSMStateID, newState client.FSMStateID, data interface{}) bool { + func(oldState client.FSMStateID, newState client.FSMStateID, data any) bool { stateCallback(oldState, newState, data, prof, dir) return true }, |
