Termuxのインストール
TermuxはAndroid用のターミナルエミュレータです。
Playストアにて「termux」を検索し、Termuxをインストールします。
Termuxを起動し以下のコマンドを実行します。
$ termux-setup-storage
$ apt update
$ apt upgrade
Go言語とgitのインストール
Termuxから、Goとgitをインストール。
$ apt install -y golang git
動作確認
Termuxにhello-worldアプリをgitクローンし、実行します。
$ git clone https://github.com/quzquz/go-http-hello-world.git
$ cd go-http-hello-world
$ go run main.go
少し待つと「Listening on port 8080」と表示されます。
Androidの適当なwebブラウザを起動しurlに以下を入力します。
http://localhost:8080
ブラウザに「Hello world!」と表示されます。
停止するには、Termux上でctrl+dを入力します。