Change the way to generate assets not to use unsafe; Unsafe doesn't work in GopherJS at least

This commit is contained in:
Hajime Hoshi 2015-01-06 22:59:15 +09:00
parent b769e0eb6c
commit b85bae38e9
2 changed files with 7 additions and 20 deletions

View File

@ -22,7 +22,7 @@ import (
const FileNameText = "text.png"
//go:generate go-bindata -nocompress -pkg=assets -nomemcopy text.png
//go:generate go-bindata -nocompress -pkg=assets text.png
//go:generate gofmt -w .
const (
@ -38,5 +38,8 @@ func TextImage() (image.Image, error) {
return nil, err
}
img, _, err := image.Decode(bytes.NewBuffer(b))
return img, err
if err != nil {
return nil, err
}
return img, nil
}

File diff suppressed because one or more lines are too long