Merge pull request #97 from ikawaha/feature/remove_unsafe_refect_from_compress_nomemcopy
Remove reflect and unsafe from header_compressed_nomemcopy
This commit is contained in:
commit
91db54b040
12
release.go
12
release.go
|
@ -103,9 +103,7 @@ func header_compressed_nomemcopy(w io.Writer) error {
|
|||
"compress/gzip"
|
||||
"fmt"
|
||||
"io"
|
||||
"reflect"
|
||||
"strings"
|
||||
"unsafe"
|
||||
"os"
|
||||
"time"
|
||||
"io/ioutil"
|
||||
|
@ -114,15 +112,7 @@ func header_compressed_nomemcopy(w io.Writer) error {
|
|||
)
|
||||
|
||||
func bindataRead(data, name string) ([]byte, error) {
|
||||
var empty [0]byte
|
||||
sx := (*reflect.StringHeader)(unsafe.Pointer(&data))
|
||||
b := empty[:]
|
||||
bx := (*reflect.SliceHeader)(unsafe.Pointer(&b))
|
||||
bx.Data = sx.Data
|
||||
bx.Len = len(data)
|
||||
bx.Cap = bx.Len
|
||||
|
||||
gz, err := gzip.NewReader(bytes.NewBuffer(b))
|
||||
gz, err := gzip.NewReader(strings.NewReader(data))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Read %%q: %%v", name, err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user