asset.go 505 B

123456789101112131415161718192021222324
  1. // Copyright 2015 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. //go:build darwin || linux || windows
  5. package asset
  6. import "io"
  7. // Open opens a named asset.
  8. //
  9. // Errors are of type *os.PathError.
  10. //
  11. // This must not be called from init when used in android apps.
  12. func Open(name string) (File, error) {
  13. return openAsset(name)
  14. }
  15. // File is an open asset.
  16. type File interface {
  17. io.ReadSeeker
  18. io.Closer
  19. }