redis icon indicating copy to clipboard operation
redis copied to clipboard

interface conversion: interface {} is map[string]interface {}, not url.Values

Open llaoj opened this issue 5 years ago • 1 comments

since I change the store to redis. this code cannot work

    store, err := session.Start(nil, w, r)
    if err != nil {
        return
    }
    if r.Form == nil {
        r.ParseForm()
    }
    store.Set("RequestForm", r.Form)
    store.Save()

...

    store, err := session.Start(nil, w, r)
    if err != nil {
        return
    }
    form, ok := store.Get("RequestForm")
    if !ok {
        return
    }
    clientID := form.(url.Values).Get("client_id")

occur this error interface conversion: interface {} is map[string]interface {}, not url.Values.

how can i fix this? thx

llaoj avatar Apr 08 '20 09:04 llaoj

Same here. Everything seems to be marshaled as map[string]interface{} and therefore does not preserve the original types.

DasJott avatar Oct 05 '22 13:10 DasJott