Browse Source

Code comments

Volodymyr Tkach 2 years ago
parent
commit
17814c080e
1 changed files with 8 additions and 1 deletions
  1. 8 1
      utils/http/helpers/helpers.go

+ 8 - 1
utils/http/helpers/helpers.go

@@ -84,7 +84,14 @@ func RespondAsMethodNotAllowed(w http.ResponseWriter, r *http.Request) {
 
 
 // Example:
 // Example:
 //
 //
-// sess := helpers.SessionStart(w, r)
+// sess, err := helpers.SessionStart(w, r)
+//
+// if err != nil && !errors.Is(err, os.ErrNotExist) {
+//
+//	helpers.RespondAsBadRequest(w, r, err)
+// 	return
+//
+// }
 //
 //
 // defer sess.Close()
 // defer sess.Close()
 func SessionStart(w http.ResponseWriter, r *http.Request) (*session.Session, error) {
 func SessionStart(w http.ResponseWriter, r *http.Request) (*session.Session, error) {