diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-09-20 12:39:38 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-09-20 12:39:38 +0200 |
| commit | b0e4e454fc94935cf8ee3282a07596ec53268a18 (patch) | |
| tree | 03b4e6a43dc823bd91a75f0fb71ad78b5b2d1218 /fsm.go | |
| parent | 2f4ddf6a1558589452c5d54674ac444e0a072b93 (diff) | |
Go vet: Fixes
Diffstat (limited to 'fsm.go')
| -rw-r--r-- | fsm.go | 76 |
1 files changed, 38 insertions, 38 deletions
@@ -102,100 +102,100 @@ func newFSM( ) fsm.FSM { states := FSMStates{ STATE_DEREGISTERED: FSMState{ - Transitions: []FSMTransition{{STATE_NO_SERVER, "Client registers"}}, + Transitions: []FSMTransition{{To: STATE_NO_SERVER, Description: "Client registers"}}, }, STATE_NO_SERVER: FSMState{ Transitions: []FSMTransition{ - {STATE_NO_SERVER, "Reload list"}, - {STATE_CHOSEN_SERVER, "User chooses a server"}, - {STATE_SEARCH_SERVER, "The user is trying to choose a Server in the UI"}, - {STATE_CONNECTED, "The user is already connected"}, - {STATE_ASK_LOCATION, "Change the location in the main screen"}, + {To: STATE_NO_SERVER, Description: "Reload list"}, + {To: STATE_CHOSEN_SERVER, Description: "User chooses a server"}, + {To: STATE_SEARCH_SERVER, Description: "The user is trying to choose a Server in the UI"}, + {To: STATE_CONNECTED, Description: "The user is already connected"}, + {To: STATE_ASK_LOCATION, Description: "Change the location in the main screen"}, }, }, STATE_SEARCH_SERVER: FSMState{ Transitions: []FSMTransition{ - {STATE_LOADING_SERVER, "User clicks a server in the UI"}, - {STATE_NO_SERVER, "Cancel or Error"}, + {To: STATE_LOADING_SERVER, Description: "User clicks a server in the UI"}, + {To: STATE_NO_SERVER, Description: "Cancel or Error"}, }, BackState: STATE_NO_SERVER, }, STATE_ASK_LOCATION: FSMState{ Transitions: []FSMTransition{ - {STATE_CHOSEN_SERVER, "Location chosen"}, - {STATE_NO_SERVER, "Go back or Error"}, - {STATE_SEARCH_SERVER, "Cancel or Error"}, + {To: STATE_CHOSEN_SERVER, Description: "Location chosen"}, + {To: STATE_NO_SERVER, Description: "Go back or Error"}, + {To: STATE_SEARCH_SERVER, Description: "Cancel or Error"}, }, }, STATE_LOADING_SERVER: FSMState{ Transitions: []FSMTransition{ - {STATE_CHOSEN_SERVER, "Server info loaded"}, + {To: STATE_CHOSEN_SERVER, Description: "Server info loaded"}, { - STATE_ASK_LOCATION, - "User chooses a Secure Internet server but no location is configured", + To: STATE_ASK_LOCATION, + Description: "User chooses a Secure Internet server but no location is configured", }, - {STATE_NO_SERVER, "Go back or Error"}, + {To: STATE_NO_SERVER, Description: "Go back or Error"}, }, BackState: STATE_NO_SERVER, }, STATE_CHOSEN_SERVER: FSMState{ Transitions: []FSMTransition{ - {STATE_AUTHORIZED, "Found tokens in config"}, - {STATE_OAUTH_STARTED, "No tokens found in config"}, + {To: STATE_AUTHORIZED, Description: "Found tokens in config"}, + {To: STATE_OAUTH_STARTED, Description: "No tokens found in config"}, }, }, STATE_OAUTH_STARTED: FSMState{ Transitions: []FSMTransition{ - {STATE_AUTHORIZED, "User authorizes with browser"}, - {STATE_NO_SERVER, "Cancel or Error"}, - {STATE_SEARCH_SERVER, "Cancel or Error"}, + {To: STATE_AUTHORIZED, Description: "User authorizes with browser"}, + {To: STATE_NO_SERVER, Description: "Cancel or Error"}, + {To: STATE_SEARCH_SERVER, Description: "Cancel or Error"}, }, BackState: STATE_NO_SERVER, }, STATE_AUTHORIZED: FSMState{ Transitions: []FSMTransition{ - {STATE_OAUTH_STARTED, "Re-authorize with OAuth"}, - {STATE_REQUEST_CONFIG, "Client requests a config"}, + {To: STATE_OAUTH_STARTED, Description: "Re-authorize with OAuth"}, + {To: STATE_REQUEST_CONFIG, Description: "Client requests a config"}, }, }, STATE_REQUEST_CONFIG: FSMState{ Transitions: []FSMTransition{ - {STATE_ASK_PROFILE, "Multiple profiles found and no profile chosen"}, - {STATE_DISCONNECTED, "Only one profile or profile already chosen"}, - {STATE_NO_SERVER, "Cancel or Error"}, - {STATE_OAUTH_STARTED, "Re-authorize"}, + {To: STATE_ASK_PROFILE, Description: "Multiple profiles found and no profile chosen"}, + {To: STATE_DISCONNECTED, Description: "Only one profile or profile already chosen"}, + {To: STATE_NO_SERVER, Description: "Cancel or Error"}, + {To: STATE_OAUTH_STARTED, Description: "Re-authorize"}, }, }, STATE_ASK_PROFILE: FSMState{ Transitions: []FSMTransition{ - {STATE_DISCONNECTED, "User chooses profile"}, - {STATE_NO_SERVER, "Cancel or Error"}, - {STATE_SEARCH_SERVER, "Cancel or Error"}, + {To: STATE_DISCONNECTED, Description: "User chooses profile"}, + {To: STATE_NO_SERVER, Description: "Cancel or Error"}, + {To: STATE_SEARCH_SERVER, Description: "Cancel or Error"}, }, }, STATE_DISCONNECTED: FSMState{ Transitions: []FSMTransition{ - {STATE_CONNECTING, "OS reports it is trying to connect"}, - {STATE_REQUEST_CONFIG, "User reconnects"}, - {STATE_NO_SERVER, "User wants to choose a new server"}, - {STATE_OAUTH_STARTED, "Re-authorize with OAuth"}, + {To: STATE_CONNECTING, Description: "OS reports it is trying to connect"}, + {To: STATE_REQUEST_CONFIG, Description: "User reconnects"}, + {To: STATE_NO_SERVER, Description: "User wants to choose a new server"}, + {To: STATE_OAUTH_STARTED, Description: "Re-authorize with OAuth"}, }, BackState: STATE_NO_SERVER, }, STATE_DISCONNECTING: FSMState{ Transitions: []FSMTransition{ - {STATE_DISCONNECTED, "Cancel or Error"}, - {STATE_DISCONNECTED, "Done disconnecting"}, + {To: STATE_DISCONNECTED, Description: "Cancel or Error"}, + {To: STATE_DISCONNECTED, Description: "Done disconnecting"}, }, }, STATE_CONNECTING: FSMState{ Transitions: []FSMTransition{ - {STATE_DISCONNECTED, "Cancel or Error"}, - {STATE_CONNECTED, "Done connecting"}, + {To: STATE_DISCONNECTED, Description: "Cancel or Error"}, + {To: STATE_CONNECTED, Description: "Done connecting"}, }, }, STATE_CONNECTED: FSMState{ - Transitions: []FSMTransition{{STATE_DISCONNECTING, "App wants to disconnect"}}, + Transitions: []FSMTransition{{To: STATE_DISCONNECTING, Description: "App wants to disconnect"}}, }, } returnedFSM := fsm.FSM{} |
