diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-08-09 14:24:07 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-08-09 14:24:07 +0200 |
| commit | 196140a4cf34640ff963f2ae08dd135c3834f0d3 (patch) | |
| tree | aaed442d916a15acd26394c58b941cee050299f0 /internal/server | |
| parent | 9c7d9958132bcea0aa5ff6ab4aaec67c73087408 (diff) | |
Formatting: Run gofumpt
Diffstat (limited to 'internal/server')
| -rw-r--r-- | internal/server/common.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/internal/server/common.go b/internal/server/common.go index be6ed46..90744e8 100644 --- a/internal/server/common.go +++ b/internal/server/common.go @@ -20,8 +20,8 @@ type ServerBase struct { Endpoints ServerEndpoints `json:"endpoints"` Profiles ServerProfileInfo `json:"profiles"` ProfilesRaw string `json:"profiles_raw"` - StartTime time.Time `json:"start_time"` - EndTime time.Time `json:"expire_time"` + StartTime time.Time `json:"start_time"` + EndTime time.Time `json:"expire_time"` Type string `json:"server_type"` FSM *fsm.FSM `json:"-"` } @@ -113,9 +113,9 @@ func (servers *Servers) GetCurrentServer() (Server, error) { } type ServersConfiguredScreen struct { - CustomServers []ServerInfoScreen `json:"custom_servers"` + CustomServers []ServerInfoScreen `json:"custom_servers"` InstituteAccessServers []ServerInfoScreen `json:"institute_access_servers"` - SecureInternetServer *ServerInfoScreen `json:"secure_internet_server"` + SecureInternetServer *ServerInfoScreen `json:"secure_internet_server"` } type ServerInfoScreen struct { @@ -123,12 +123,12 @@ type ServerInfoScreen struct { DisplayName map[string]string `json:"display_name"` CountryCode string `json:"country_code,omitempty"` SupportContact []string `json:"support_contact"` - Profiles ServerProfileInfo `json:"profiles"` + Profiles ServerProfileInfo `json:"profiles"` ExpireTime int64 `json:"expire_time"` Type string `json:"server_type"` } -func getServerInfoScreen(base ServerBase) (ServerInfoScreen) { +func getServerInfoScreen(base ServerBase) ServerInfoScreen { serverInfoScreen := ServerInfoScreen{} serverInfoScreen.Identifier = base.URL serverInfoScreen.DisplayName = base.DisplayName @@ -302,8 +302,8 @@ func ShouldRenewButton(server Server) bool { // Session duration is less than 24 hours but not 75% has passed duration := base.EndTime.Sub(base.StartTime) - percentTime := base.StartTime.Add((duration/4)*3) - if duration < time.Duration(24 * time.Hour) && !current.After(percentTime) { + percentTime := base.StartTime.Add((duration / 4) * 3) + if duration < time.Duration(24*time.Hour) && !current.After(percentTime) { return false } |
