mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
detail:
1. add utils.BytesToString function instead of string() convert bytes to string.
2. use bytes.NewReader instead of strings.NewReader(string(sb)).
3. use w.Body.Bytes() instead of []byte(w.Body.String()).
8 lines
111 B
Go
8 lines
111 B
Go
package utils
|
|
|
|
import "unsafe"
|
|
|
|
func BytesToString(b []byte) string {
|
|
return *(*string)(unsafe.Pointer(&b))
|
|
}
|