summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-08-09 14:24:07 +0200
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-08-09 14:24:07 +0200
commit196140a4cf34640ff963f2ae08dd135c3834f0d3 (patch)
treeaaed442d916a15acd26394c58b941cee050299f0
parent9c7d9958132bcea0aa5ff6ab4aaec67c73087408 (diff)
Formatting: Run gofumpt
-rw-r--r--internal/discovery/discovery.go2
-rw-r--r--internal/oauth/oauth.go10
-rw-r--r--internal/server/common.go16
-rw-r--r--internal/types/server.go4
-rw-r--r--state.go2
5 files changed, 17 insertions, 17 deletions
diff --git a/internal/discovery/discovery.go b/internal/discovery/discovery.go
index d4cff41..733b446 100644
--- a/internal/discovery/discovery.go
+++ b/internal/discovery/discovery.go
@@ -6,8 +6,8 @@ import (
"time"
"github.com/jwijenbergh/eduvpn-common/internal/http"
- "github.com/jwijenbergh/eduvpn-common/internal/util"
"github.com/jwijenbergh/eduvpn-common/internal/types"
+ "github.com/jwijenbergh/eduvpn-common/internal/util"
"github.com/jwijenbergh/eduvpn-common/internal/verify"
)
diff --git a/internal/oauth/oauth.go b/internal/oauth/oauth.go
index 79f4ebf..75a2e9f 100644
--- a/internal/oauth/oauth.go
+++ b/internal/oauth/oauth.go
@@ -82,11 +82,11 @@ type OAuthExchangeSession struct {
// Struct that defines the json format for /.well-known/vpn-user-portal"
type OAuthToken struct {
- Access string `json:"access_token"`
- Refresh string `json:"refresh_token"`
- Type string `json:"token_type"`
- Expires int64 `json:"expires_in"`
- ExpiredTimestamp time.Time `json:"expires_in_timestamp"`
+ Access string `json:"access_token"`
+ Refresh string `json:"refresh_token"`
+ Type string `json:"token_type"`
+ Expires int64 `json:"expires_in"`
+ ExpiredTimestamp time.Time `json:"expires_in_timestamp"`
}
// Gets an authorized HTTP client by obtaining refresh and access tokens
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
}
diff --git a/internal/types/server.go b/internal/types/server.go
index e626183..18d242a 100644
--- a/internal/types/server.go
+++ b/internal/types/server.go
@@ -12,7 +12,7 @@ import (
type DiscoveryOrganizations struct {
Version uint64 `json:"v"`
List []DiscoveryOrganization `json:"organization_list"`
- Timestamp time.Time `json:"-"`
+ Timestamp time.Time `json:"-"`
RawString string `json:"-"`
}
@@ -30,7 +30,7 @@ type DiscoveryOrganization struct {
type DiscoveryServers struct {
Version uint64 `json:"v"`
List []DiscoveryServer `json:"server_list"`
- Timestamp time.Time `json:"-"`
+ Timestamp time.Time `json:"-"`
RawString string `json:"-"`
}
diff --git a/state.go b/state.go
index be32c15..7f29369 100644
--- a/state.go
+++ b/state.go
@@ -99,7 +99,7 @@ func (state *VPNState) GoBack() error {
// FIXME: Abitrary back transitions don't work because we need the approriate data
state.FSM.GoTransitionWithData(fsm.NO_SERVER, state.GetSavedServers(), false)
- //state.FSM.GoBack()
+ // state.FSM.GoBack()
return nil
}