Decode
Overview
Decode parses claims without verifying the signature (jwt.decode).
If you are coming from Node.js, the closest pattern is jwt.decode(token).
Signature
go
func Decode(token string) (jwtlib.MapClaims, error)Compare: Node.js · Standard Go · gox
js
jwt.decode(token)go
// github.com/golang-jwt/jwt/v5 token.Sign / Parsego
import "github.com/sahilkhaire/gox/jwt"
jwt.Decode(token)Example
go
import "github.com/sahilkhaire/gox/jwt"
jwt.Decode(token)Tips
Import github.com/sahilkhaire/gox/jwt and call Decode directly. See the comparison below for the standard library equivalent.
Standard library alternative
gox wraps the Go standard library or a trusted dependency with Node-familiar naming. You can use the underlying library directly — see the package overview for escape hatches.