2014-12-05 18:52:06 +00:00
|
|
|
// Copyright 2014 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
2015-06-29 11:21:27 +00:00
|
|
|
// +build linux,!android darwin,!arm,!arm64
|
2014-12-05 18:52:06 +00:00
|
|
|
|
2015-06-29 11:21:27 +00:00
|
|
|
package asset
|
2014-12-05 18:52:06 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"path/filepath"
|
|
|
|
)
|
|
|
|
|
2015-06-29 11:21:27 +00:00
|
|
|
func openAsset(name string) (File, error) {
|
2014-12-05 18:52:06 +00:00
|
|
|
if !filepath.IsAbs(name) {
|
|
|
|
name = filepath.Join("assets", name)
|
|
|
|
}
|
|
|
|
f, err := os.Open(name)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return f, nil
|
|
|
|
}
|