2
0
mirror of synced 2025-02-23 23:08:14 +00:00
mobile/app/desktop.go
David Crawshaw 2d6073265a x/mobile/app: Open function for basic asset management
LGTM=hyangah
R=hyangah
CC=golang-codereviews
https://golang.org/cl/187740044
2014-12-05 13:52:06 -05:00

26 lines
487 B
Go

// 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.
// +build !android
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
}