asset: warn asset.Open must not be called from init.

Currently there is no easy way to fix golang/go#12077
so we document it.

Fixes golang/go#12077

Change-Id: I6b37ae375673c055152dad5b93e180d9831aef76
Reviewed-on: https://go-review.googlesource.com/13430
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Hyang-Ah (Hana) Kim 2015-08-08 09:15:22 -04:00 коммит произвёл Hyang-Ah Hana Kim
Родитель ea3ef0580c
Коммит 9e2563f3e7
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -23,6 +23,8 @@ import "io"
// Open opens a named asset.
//
// Errors are of type *os.PathError.
//
// This must not be called from init when used in android apps.
func Open(name string) (File, error) {
return openAsset(name)
}