Skip to content

Commit abc3961

Browse files
committed
Fix abandoned usage: use 'rand.Read' instead of 'rand.Reader' to generate a random string
1 parent ac119cc commit abc3961

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

zh/06.2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Session ID是用来识别访问Web应用的每一个用户,因此必须保证
111111

112112
func (manager *Manager) sessionId() string {
113113
b := make([]byte, 32)
114-
if _, err := io.ReadFull(rand.Reader, b); err != nil {
114+
if _, err := rand.Read(b); err != nil {
115115
return ""
116116
}
117117
return base64.URLEncoding.EncodeToString(b)

0 commit comments

Comments
 (0)