asset: do not use 'assets' directory for iOS The iOS implementation was just copied from the desktop version, and had and extra directory 'assets'. Also, files had an incorrect assumption that Arm Darwin should be an iOS. This change addresses these issues. Fixes golang/go#37177 Change-Id: I8e4de5337fbbe0b7697a8d519c8bded783399244 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/616655 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Hyang-Ah Hana Kim <hyangah@gmail.com> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
diff --git a/asset/asset_darwin_armx.go b/asset/asset_darwin_armx.go deleted file mode 100644 index e3b3b5a..0000000 --- a/asset/asset_darwin_armx.go +++ /dev/null
@@ -1,23 +0,0 @@ -// Copyright 2015 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. - -//go:build darwin && (arm || arm64) - -package asset - -import ( - "os" - "path/filepath" -) - -func openAsset(name string) (File, error) { - if !filepath.IsAbs(name) { - name = filepath.Join("assets", name) - } - f, err := os.Open(name) - if err != nil { - return nil, err - } - return f, nil -}
diff --git a/asset/asset_desktop.go b/asset/asset_desktop.go index af7c45f..1c38056 100644 --- a/asset/asset_desktop.go +++ b/asset/asset_desktop.go
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build (linux && !android) || (darwin && !arm && !arm64) || windows +//go:build (linux && !android) || (darwin && !ios) || windows package asset
diff --git a/asset/asset_ios.go b/asset/asset_ios.go new file mode 100644 index 0000000..4b7b37f --- /dev/null +++ b/asset/asset_ios.go
@@ -0,0 +1,13 @@ +// Copyright 2024 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. + +package asset + +import ( + "os" +) + +func openAsset(name string) (File, error) { + return os.Open(name) +}