diff options
| -rw-r--r-- | client/client_test.go | 2 | ||||
| -rw-r--r-- | exports/exports.go | 18 | ||||
| -rw-r--r-- | internal/discovery/discovery_test.go | 3 | ||||
| -rw-r--r-- | internal/failover/monitor.go | 2 | ||||
| -rw-r--r-- | internal/log/log.go | 2 | ||||
| -rw-r--r-- | internal/oauth/token.go | 1 |
6 files changed, 13 insertions, 15 deletions
diff --git a/client/client_test.go b/client/client_test.go index 64c0430..3c57af5 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -11,8 +11,8 @@ import ( "time" httpw "github.com/eduvpn/eduvpn-common/internal/http" - "github.com/eduvpn/eduvpn-common/internal/util" "github.com/eduvpn/eduvpn-common/internal/oauth" + "github.com/eduvpn/eduvpn-common/internal/util" "github.com/go-errors/errors" ) diff --git a/exports/exports.go b/exports/exports.go index db353c9..89d18dc 100644 --- a/exports/exports.go +++ b/exports/exports.go @@ -31,8 +31,8 @@ static int call_callback(PythonCB callback, const char *name, int oldstate, int import "C" import ( - "unsafe" "time" + "unsafe" "github.com/eduvpn/eduvpn-common/internal/log" "github.com/eduvpn/eduvpn-common/internal/oauth" @@ -307,8 +307,8 @@ func GetConfigSecureInternet( } preferTCPBool := preferTCP == 1 t := oauth.Token{ - Access: C.GoString(prevTokens.access), - Refresh: C.GoString(prevTokens.refresh), + Access: C.GoString(prevTokens.access), + Refresh: C.GoString(prevTokens.refresh), ExpiredTimestamp: time.Unix(int64(prevTokens.expired), 0), } cfg, configErr := state.GetConfigSecureInternet(C.GoString(orgID), preferTCPBool, t) @@ -329,8 +329,8 @@ func GetConfigInstituteAccess( } preferTCPBool := preferTCP == 1 t := oauth.Token{ - Access: C.GoString(prevTokens.access), - Refresh: C.GoString(prevTokens.refresh), + Access: C.GoString(prevTokens.access), + Refresh: C.GoString(prevTokens.refresh), ExpiredTimestamp: time.Unix(int64(prevTokens.expired), 0), } cfg, configErr := state.GetConfigInstituteAccess(C.GoString(url), preferTCPBool, t) @@ -351,8 +351,8 @@ func GetConfigCustomServer( } preferTCPBool := preferTCP == 1 t := oauth.Token{ - Access: C.GoString(prevTokens.access), - Refresh: C.GoString(prevTokens.refresh), + Access: C.GoString(prevTokens.access), + Refresh: C.GoString(prevTokens.refresh), ExpiredTimestamp: time.Unix(int64(prevTokens.expired), 0), } cfg, configErr := state.GetConfigCustomServer(C.GoString(url), preferTCPBool, t) @@ -422,8 +422,8 @@ func SetDisconnected(name *C.char, cleanup C.int, prevTokens C.token) *C.error { return getError(stateErr) } t := oauth.Token{ - Access: C.GoString(prevTokens.access), - Refresh: C.GoString(prevTokens.refresh), + Access: C.GoString(prevTokens.access), + Refresh: C.GoString(prevTokens.refresh), ExpiredTimestamp: time.Unix(int64(prevTokens.expired), 0), } setDisconnectedErr := state.SetDisconnected(int(cleanup) == 1, t) diff --git a/internal/discovery/discovery_test.go b/internal/discovery/discovery_test.go index 8d16452..9d6b914 100644 --- a/internal/discovery/discovery_test.go +++ b/internal/discovery/discovery_test.go @@ -13,7 +13,7 @@ import ( ) // setupFileServer sets up a file server with a directory -func setupFileServer(t *testing.T, directory string) (*http.Server) { +func setupFileServer(t *testing.T, directory string) *http.Server { listener, err := net.Listen("tcp", ":0") if err != nil { t.Fatalf("Failed to setup discovery file server") @@ -197,7 +197,6 @@ func TestServerByCountryCode(t *testing.T) { // TestOrgByID tests the function for getting an organization by ID func TestOrgByID(t *testing.T) { - o1 := types.DiscoveryOrganization{OrgID: "a"} d := Discovery{ organizations: types.DiscoveryOrganizations{ diff --git a/internal/failover/monitor.go b/internal/failover/monitor.go index ed532f7..a6916be 100644 --- a/internal/failover/monitor.go +++ b/internal/failover/monitor.go @@ -4,8 +4,8 @@ import ( "context" "time" - "github.com/go-errors/errors" "github.com/eduvpn/eduvpn-common/internal/log" + "github.com/go-errors/errors" ) // The DroppedConMon is a connection monitor that checks for an increase in rx bytes in certain intervals diff --git a/internal/log/log.go b/internal/log/log.go index 64d9fb8..8b559fb 100644 --- a/internal/log/log.go +++ b/internal/log/log.go @@ -113,7 +113,7 @@ func (logger *FileLogger) Init(lvl Level, dir string) error { // Inheritf logs an error with a message and params using the error level verbosity of the error. // The message is always prefixed with the error. -func (logger *FileLogger) Inheritf(err error, msg string, params...interface{}) { +func (logger *FileLogger) Inheritf(err error, msg string, params ...interface{}) { if err == nil { return } diff --git a/internal/oauth/token.go b/internal/oauth/token.go index 4ed8f43..c1d72f8 100644 --- a/internal/oauth/token.go +++ b/internal/oauth/token.go @@ -113,7 +113,6 @@ func (l *tokenLock) Update(r Token) { l.mu.Unlock() } - // Get gets the tokens into a public struct func (l *tokenLock) Get() Token { // TODO: Check nil? |
