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-01-16 23:17:57 +00:00
|
|
|
// +build linux,!android darwin
|
2014-12-05 18:52:06 +00:00
|
|
|
|
|
|
|
package app
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"path/filepath"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Logic shared by desktop debugging implementations.
|
|
|
|
|
|
|
|
func openAsset(name string) (ReadSeekCloser, error) {
|
|
|
|
if !filepath.IsAbs(name) {
|
|
|
|
name = filepath.Join("assets", name)
|
|
|
|
}
|
|
|
|
f, err := os.Open(name)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return f, nil
|
|
|
|
}
|