1. Project Overview & Quickstart (golang/mobile)
File: README.md
Go support for Mobile devices
The Go mobile repository holds packages and build tools for using Go on mobile platforms.
Package documentation as a starting point:
The Go Mobile project is experimental. Use this at your own risk.
While we are working hard to improve it, neither Google nor the Go
team can provide end-user support.
This is early work and installing the build system requires Go 1.5.
Follow the instructions on
golang.org/wiki/Mobile
to install the gomobile command, build the
basic
and the bind example apps.
--
Contributions to Go are appreciated. See https://go.dev/doc/contribute.
The git repository is https://go.googlesource.com/mobile.
- Bugs can be filed at the Go issue tracker.
- Feature requests should preliminary be discussed on
golang-nuts
mailing list.
File: example/ivy/android/README.md
Ivy Big Number Calculator (Android)
Ivy (robpike.io/ivy) is an interpreter for an APL-like language written in Go.
This repository hosts a minimal Android project used for its Android version.
How to build
Requirements
- Go 1.17 or newer
- Android SDK
- Android NDK
golang.org/x/mobile/cmd/gomobile
The gomobile command respects the ANDROID_HOME and ANDROID_NDK_HOME environment variables. If gomobile can't find your SDK and NDK, you can set these environment variables to specify their locations:
export ANDROID_HOME=/path/to/sdk-directory
export ANDROID_NDK_HOME=/path/to/ndk-directoryFrom this directory, run:
go install golang.org/x/mobile/cmd/gomobile@latest
go install golang.org/x/mobile/cmd/gobind@latest
# Make sure `gomobile` and `gobind` is in your `PATH`.
gomobile bind -o app/ivy.aar robpike.io/ivy/mobileOpen this directory from Android Studio, and build.
robpike.io/ivy and golang.org/x/mobile are required dependencies of this main module. In order to update them:
go get -d golang.org/x/mobile@latest
go get -d robpike.io/ivy/mobile
go mod tidyFile: example/ivy/ios/README.md
Ivy iOS App source
This directory contains the source code to the Ivy iOS app.
To build, first create the Mobile.xcframework out of the Go
implementation of Ivy. Run:
go install golang.org/x/mobile/cmd/gomobile@latest
go install golang.org/x/mobile/cmd/gobind@latestto install gomobile and gobind. Then:
mkdir work; cd work
go mod init work
go get -d golang.org/x/mobile/bind@latest
go get -d robpike.io/ivy/mobile
gomobile bind -target=ios,iossimulator,maccatalyst,macos robpike.io/ivy/mobile robpike.io/ivy/demoPlace the Mobile.xcframework directory in this directory, and
then open ivy.xcodeproj in Xcode.
You have to specify Development Team for code signing certificate in:
Project Settings -> Targets -> Signing & Capabilities -> Signing -> Team.
2. Official Technical Reference & Guides (golang/website)
Go website
This repo holds content and serving programs for the go.dev and golang.org web sites.
Content is in _content/ (go.dev) and tour/ (go.dev/tour).
Server code is in cmd/ and internal/.
To run the combined go.dev+golang.org server to preview local content changes, use:
go run ./cmd/golangorgThe supporting programs cmd/admingolangorg and cmd/googlegolangorg
are the servers for admin.golang.org and google.golang.org.
(They do not use the _content/ directories.)
Each command directory has its own README.md explaining deployment.
JS/TS/CSS Formatting
This repository uses eslint to format JS and TS files,
and stylelint to format CSS files.
See also:
It is encouraged that all JS, TS, and CSS code be run through formatters before
submitting a change. However, it is not a strict requirement enforced by CI.
Installing npm Dependencies:
- Install docker
- Create a .gitignore file at repo root
- Add .gitignore and node_modules to .gitignore
- Run
./npm install
Run ESlint
./npx eslint [options] [file] [dir]Run Stylelint
./npx stylelint [input] [options]TypeScript Support
TypeScript files served from _content are transformed into JavaScript.
Reference .ts files in html templates as module code.
<script type="module" src="/ts/filename.ts">
Write unit tests for TypeScript code using the jest
testing framework.
Run Jest
./npx jest [TestPathPattern]Deploying
Each time a CL is reviewed and submitted, the code is deployed to App Engine.
See cmd/golangorg/README.md for details.
Report Issues / Send Patches
This repository uses Gerrit for code changes. To learn how to submit changes to
this repository, see https://go.dev/doc/contribute.
The git repository is https://go.googlesource.com/website.
The main issue tracker for the website repository is located at
https://go.dev/issues. Prefix your issue with "x/website:" in the
subject line, so it is easy to find.