Golang VM by Anarion Technologies
Go, often referred to as Golang, is an open-source programming language that was created by Google and first released in 2009. It was designed with simplicity and efficiency in mind, aiming to address the shortcomings of other programming languages. Go features a clean and concise syntax that facilitates readability and ease of use, making it accessible for both novice and experienced developers.
One of Go’s standout features is its strong support for concurrent programming. The language includes built-in support for goroutines and channels, which allow developers to write programs that can perform multiple tasks simultaneously without complex thread management. This makes Go particularly well-suited for developing high-performance, scalable applications such as web servers, networking tools, and distributed systems.
Go also emphasizes performance and efficiency. Its design includes a garbage collector for automatic memory management, which helps prevent memory leaks and reduces the burden on developers to manage memory manually. Additionally, Go is a statically typed, compiled language, meaning that code is compiled into machine code before execution, which contributes to its fast execution speed and runtime performance.
The language comes with a robust standard library that provides a wide range of built-in functions and packages, covering everything from handling HTTP requests to manipulating data. This extensive standard library allows developers to build complex applications without needing to rely on external libraries for many common tasks.
To subscribe to this product from Azure Marketplace and initiate an instance using the Azure compute service, follow these steps:
1. Navigate to Azure Marketplace and subscribe to the desired product.
2. Search for “virtual machines” and select “Virtual machines” under Services.
3. Click on “Add” in the Virtual machines page, which will lead you to the Create a virtual machine page.
4. In the Basics tab:
- Ensure the correct subscription is chosen under Project details.
- Opt for creating a new resource group by selecting “Create new resource group” and name it as “myResourceGroup.”
5. Under Instance details:
- Enter “myVM” as the Virtual machine name.
- Choose “East US” as the Region.
- Select “Ubuntu 18.04 LTS” as the Image.
- Leave other settings as default.
6. For Administrator account:
- Pick “SSH public key.”
- Provide your user name and paste your public key, ensuring no leading or trailing white spaces.
7. Under Inbound port rules > Public inbound ports:
- Choose “Allow selected ports.”
- Select “SSH (22)” and “HTTP (80)” from the drop-down.
8. Keep the remaining settings at their defaults and click on “Review + create” at the bottom of the page.
9. The “Create a virtual machine” page will display the details of the VM you’re about to create. Once ready, click on “Create.”
10. The deployment process will take a few minutes. Once it’s finished, proceed to the next section.
To connect to the virtual machine:
1. Access the overview page of your VM and click on “Connect.”
2. On the “Connect to virtual machine” page:
- Keep the default options for connecting via IP address over port 22.
- A connection command for logging in will be displayed. Click the button to copy the command. Here’s an example of what the SSH connection command looks like:
“`
ssh [email protected]
“`
3. Using the same bash shell that you used to generate your SSH key pair, you can either reopen the Cloud Shell by selecting >_ again
or going to https://shell.azure.com/bash.
4. Paste the SSH connection command into the shell to initiate an SSH session.
Usage/Deployment Instructions
Anarion Technologies – Golang
Note: Search product on Azure marketplace and click on “Get it now”
Click on Continue
Click on Create
Creating a Virtual Machine, enter or select appropriate values for zone, machine type, resource group and so on as per your choice.
After Process of Create Virtual Machine. You have got an Option Go to Resource Group
Copy the Public IP Address
SSH into Terminal and run these following commands:
Set the PATH Variable
When you work with Go, you must be able to access the Go command from any of your systems’ directories. To enable this functionality, you need to configure the PATH environment variable by adding the path of Go executables in the ~/.profile or ~/.bashrc file. Use the following command to set the path
$ echo
export
PATH=$HOME/go/bin:/usr/local/go/bin:
$PATH
>> ~/.profile
This command will insert the updated PATH variable in the profile file. Alternatively, you can open the file profile file using ‘vi’ or ‘nano’ and directly insert the above line. Then, save the changes by sourcing the file using the following command.
$
source ~/.profile
Verify the Golang installation
$ go version
In this example, the ‘go1.22.5’ part shows the installed version of Go. The ‘linux/amd64’ indicates the
operating system and the architecture for which Go is installed.
Test Go installation
To check if Go is installed correctly, you can create a simple Go program and check if the correct
output is generated. First, create a folder in your workspace and add the file 'test. go'. Insert the
following code in the Go file.
$ nano test.go
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}
Then, run the simple go program using the following command
$ go run test.go
If it outputs "Hello, World!" you can confirm your Golang is working.
Thankyou!!