From 869ec64697cc62bf4661b4976274634cffefa0e7 Mon Sep 17 00:00:00 2001 From: zebox Date: Sat, 8 Jan 2022 16:11:06 +0300 Subject: [PATCH] refactor --- _example/main.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/_example/main.go b/_example/main.go index 49c3b94..43e2f27 100644 --- a/_example/main.go +++ b/_example/main.go @@ -10,11 +10,6 @@ import ( "encoding/json" "encoding/pem" "fmt" - "github.com/go-chi/chi/v5" - "github.com/go-chi/chi/v5/middleware" - "github.com/golang-jwt/jwt" - "github.com/zebox/gojwk" - "github.com/zebox/gojwk/storage" "io" "log" "math/big" @@ -22,6 +17,12 @@ import ( "net/http" "strings" "time" + + "github.com/go-chi/chi/v5" + "github.com/go-chi/chi/v5/middleware" + "github.com/golang-jwt/jwt" + "github.com/zebox/gojwk" + "github.com/zebox/gojwk/storage" ) type token struct { @@ -29,6 +30,7 @@ type token struct { } func main() { + ctx, ctxCancel := context.WithCancel(context.Background()) keys, jwk, err := initKeys()