chore: change interface{} to any (#2818)
* chore: change interface{} to any
* chore: update goctl version to 1.5.0
* chore: update goctl deps
This commit is contained in:
@@ -32,7 +32,7 @@ func TestTokenParser(t *testing.T) {
|
||||
|
||||
for _, pair := range keys {
|
||||
req := httptest.NewRequest(http.MethodGet, "http://localhost", http.NoBody)
|
||||
token, err := buildToken(key, map[string]interface{}{
|
||||
token, err := buildToken(key, map[string]any{
|
||||
"key": "value",
|
||||
}, 3600)
|
||||
assert.Nil(t, err)
|
||||
@@ -51,7 +51,7 @@ func TestTokenParser_Expired(t *testing.T) {
|
||||
prevKey = "B63F477D-BBA3-4E52-96D3-C0034C27694A"
|
||||
)
|
||||
req := httptest.NewRequest(http.MethodGet, "http://localhost", http.NoBody)
|
||||
token, err := buildToken(key, map[string]interface{}{
|
||||
token, err := buildToken(key, map[string]any{
|
||||
"key": "value",
|
||||
}, 3600)
|
||||
assert.Nil(t, err)
|
||||
@@ -70,7 +70,7 @@ func TestTokenParser_Expired(t *testing.T) {
|
||||
assert.Equal(t, "value", tok.Claims.(jwt.MapClaims)["key"])
|
||||
}
|
||||
|
||||
func buildToken(secretKey string, payloads map[string]interface{}, seconds int64) (string, error) {
|
||||
func buildToken(secretKey string, payloads map[string]any, seconds int64) (string, error) {
|
||||
now := time.Now().Unix()
|
||||
claims := make(jwt.MapClaims)
|
||||
claims["exp"] = now + seconds
|
||||
|
||||
Reference in New Issue
Block a user