How to Install Golang on Your Android

in #golang4 years ago (edited)

Golang is a simple, efficient and powerful language it's good for web and API developments at the moment but lots of developments are coming.

golang android

If you beginner want to learn golang but you don't have any pc for learn golang don't worry you have powerful device that is your android smartphone. Smartphone is best device for programming for learning purpose so now we see how to install golang on android.

In this tutorial post I use tool is termux. Termux is a bash style android app it's very featured android bash type app.

Introduction

First install termux in playstore

https://play.google.com/store/apps/details?id=com.termux

Then open the app type

pkg install golang

it need 500+MB data for download the golang

Once download and installation is finished then type

go version

You get the latest version of golang installed on your android

Next type

pkg install vim

Vim is a open source editor for programming its need 26MB data for download. Installation is finished then type on your terminal

Now you need to create a golang program so follow the below steps

vim program.go

click i key then type the code


package main

import "fmt"

func main() {

fmt.Println("hello world")

}

click to save the file esc key and type : wq

Now you compile your golang program. Type the follow commands


go build program.go

./program

hello world

Congrats you created your first golang program.

If you like this post please follow our blog and have any doubts please comment below this post.


Are you new for hive create your own hive account for free signup here create hive account

Sort:  

Upvoted by GITPLAIT!

We have a curation trial on Hive.vote. you can earn a passive income by delegating to @gitplait
We share 80 % of the curation rewards with the delegators.

To delegate, use the links or adjust 10HIVE, 20HIVE, 50HIVE, 100HIVE, 200HIVE, 500HIVE, 1,000HIVE, 10,000HIVE, 100,000HIVE

Join the Community and chat with us on Discord let’s solve problems & build together.

I recommend you use F-Droid instead of playstore to install Termux

Definitely I will