From 3a6b1c1c013a83cfc05f7cdb2593438415005e1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=85?= Date: Wed, 15 Mar 2023 11:25:30 +0800 Subject: [PATCH] doc: update README --- README.md | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 128cae3..f7dfa62 100644 --- a/README.md +++ b/README.md @@ -54,10 +54,7 @@ Now encrypt it: ```go key := paseto.NewV4SymmetricKey() // don't share this!! -encrypted, err := token.V4Encrypt(key, nil) -if err != nil { - // panic or deal with error -} +encrypted := token.V4Encrypt(key, nil) ``` Or sign it (this allows recievers to verify it without sharing secrets): @@ -66,10 +63,7 @@ Or sign it (this allows recievers to verify it without sharing secrets): secretKey := paseto.NewV4AsymmetricSecretKey() // don't share this!!! publicKey := secretKey.Public() // DO share this one -signed, err := token.V4Sign(secretKey, nil) -if err != nil { - // panic or deal with error -} +signed := token.V4Sign(secretKey, nil) ``` To handle a recieved token, let's use an example from Paseto's test vectors: