@@ -53,7 +53,7 @@ func makeURL(path ...string) string {
53
53
return strings .Join (path , urlSeparator )
54
54
}
55
55
56
- // Compares the provided version against the current version of the Keycloak server.
56
+ // compareVersions compares the provided version against the current version of the Keycloak server.
57
57
// Current version is fetched from the serverinfo if not already set.
58
58
//
59
59
// Returns:
@@ -63,15 +63,15 @@ func makeURL(path ...string) string {
63
63
// 0 if the provided version is equal to the server version
64
64
//
65
65
// 1 if the provided version is higher than the server version
66
- func (g * GoCloak ) compareVersions (v , token string , ctx context. Context ) (int , error ) {
66
+ func (g * GoCloak ) compareVersions (ctx context. Context , v , token string ) (int , error ) {
67
67
curVersion := g .Config .version
68
68
if curVersion == "" {
69
69
curV , err := g .getServerVersion (ctx , token )
70
70
if err != nil {
71
71
return 0 , err
72
72
}
73
73
74
- curVersion = curV
74
+ curVersion = curV //nolint
75
75
}
76
76
77
77
curVersion = "v" + g .Config .version
@@ -3590,7 +3590,7 @@ func (g *GoCloak) GetPolicies(ctx context.Context, token, realm, idOfClient stri
3590
3590
return nil , errors .Wrap (err , errMessage )
3591
3591
}
3592
3592
3593
- compResult , err := g .compareVersions ("20.0.0" , token , ctx )
3593
+ compResult , err := g .compareVersions (ctx , "20.0.0" , token )
3594
3594
if err != nil {
3595
3595
return nil , err
3596
3596
}
@@ -3622,7 +3622,7 @@ func (g *GoCloak) CreatePolicy(ctx context.Context, token, realm, idOfClient str
3622
3622
return nil , errors .New ("type of a policy required" )
3623
3623
}
3624
3624
3625
- compResult , err := g .compareVersions ("20.0.0" , token , ctx )
3625
+ compResult , err := g .compareVersions (ctx , "20.0.0" , token )
3626
3626
if err != nil {
3627
3627
return nil , err
3628
3628
}
@@ -3655,7 +3655,7 @@ func (g *GoCloak) UpdatePolicy(ctx context.Context, token, realm, idOfClient str
3655
3655
return errors .New ("ID of a policy required" )
3656
3656
}
3657
3657
3658
- compResult , err := g .compareVersions ("20.0.0" , token , ctx )
3658
+ compResult , err := g .compareVersions (ctx , "20.0.0" , token )
3659
3659
if err != nil {
3660
3660
return err
3661
3661
}
0 commit comments