File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -2,12 +2,13 @@ package main
22
33import (
44"fmt"
5- "github.com/satori/go.uuid"
6- "golang.org/x/crypto/bcrypt"
75"html/template"
86"io/ioutil"
97"net/http"
108"time"
9+
10+ uuid "github.com/satori/go.uuid"
11+ "golang.org/x/crypto/bcrypt"
1112)
1213
1314type user struct {
@@ -87,7 +88,7 @@ func signup(w http.ResponseWriter, req *http.Request) {
8788return
8889}
8990// create session
90- sID , _ := uuid .NewV4 ()
91+ sID := uuid .NewV4 ()
9192c := & http.Cookie {
9293Name : "session" ,
9394Value : sID .String (),
@@ -134,7 +135,7 @@ func login(w http.ResponseWriter, req *http.Request) {
134135return
135136}
136137// create session
137- sID , _ := uuid .NewV4 ()
138+ sID := uuid .NewV4 ()
138139c := & http.Cookie {
139140Name : "session" ,
140141Value : sID .String (),
Original file line number Diff line number Diff line change @@ -2,16 +2,17 @@ package main
22
33import (
44"fmt"
5- "github.com/satori/go.uuid"
65"net/http"
76"time"
7+
8+ uuid "github.com/satori/go.uuid"
89)
910
1011func getUser (w http.ResponseWriter , req * http.Request ) user {
1112// get cookie
1213c , err := req .Cookie ("session" )
1314if err != nil {
14- sID , _ := uuid .NewV4 ()
15+ sID := uuid .NewV4 ()
1516c = & http.Cookie {
1617Name : "session" ,
1718Value : sID .String (),
You can’t perform that action at this time.
0 commit comments