From ca2738072a22a1da7412c899ca742659415369d5 Mon Sep 17 00:00:00 2001 From: ehlxr Date: Thu, 25 Jan 2018 09:45:24 +0800 Subject: [PATCH] Optimize code --- .gitignore | 3 ++- utils/jwt/demo.json | 3 +++ utils/jwt/main.go | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 utils/jwt/demo.json diff --git a/.gitignore b/.gitignore index 4769662..e9e22a6 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,5 @@ vendor JetBrainsLicenseServer* utils/jbls/jbls -utils/jwt/jwt \ No newline at end of file +utils/jwt/jwt +.idea \ No newline at end of file diff --git a/utils/jwt/demo.json b/utils/jwt/demo.json new file mode 100644 index 0000000..b42f309 --- /dev/null +++ b/utils/jwt/demo.json @@ -0,0 +1,3 @@ +{ + "foo": "bar" +} \ No newline at end of file diff --git a/utils/jwt/main.go b/utils/jwt/main.go index b64bba7..b804abd 100644 --- a/utils/jwt/main.go +++ b/utils/jwt/main.go @@ -166,7 +166,8 @@ func signToken() error { if err != nil { return fmt.Errorf("Couldn't read token: %v", err) } else if *flagDebug { - fmt.Fprintf(os.Stderr, "Token: %v bytes", len(tokData)) + fmt.Fprintf(os.Stderr, "Token len: %v bytes\n", len(tokData)) + fmt.Fprintf(os.Stderr, "Token data: %v \n", string(tokData)) } // parse the JSON of the claims