Skip to main content

Hello world with Golang

Hello world with Go Lang

Overview

hello, last blog I have explained why I have started learning go and why should one use go for. if you are interested in reading that blog please clink on this link. if you already decided to learn go then this blog is for you.

this blog will explain the way you should 

  • install Golang 
  • setup editor for Golang
  • hello world with Golang 

Install Go Lang

go to Golang official website and fallow the image instruction below.

install Go Lang step 1

install Go Lang step 2 image

check Go Lang is installed cmd command


Setup editor for Golang

I am using VS code text editor for go programming language. fallow the instruction below to setup go on VS Code. 
  • Install Go Official extension in VS code. 
Go Lang Official extension
    
  • press ctrl + shift + p to update and install necessary tools for Go Lang. 

update and install necessary tools go lang

update and install necessary tools go lang

Hello World With Golang:

hello world with go lang


Previous Blog Next Blog
Why Golang Golang Commands

Comments

Popular posts from this blog

CRUD with Golang

  Overview this blog will be about a  basic crud app with golang .   this app will provide API to store, update, delete information . you need to know the basics of golang to understand this project. if you do not have the basics knowledge  about golang I would suggest you to read my previous blog.  I have uploaded my code in  GitHub. click the link to clone or download this project  I am going to talk about the topic below. Project setup Data handling controller Project setup  Initiate mod and set up project as per golang. if you don't know how to setup golang project i would suggest you to have a look at my blog  Creating a project with golang . this is a really short blog. you will have a quick over view of how to setup a project with golang.  so now that you have setup the project then the folder structure will be as below. Data Handling data store, delete and update will be handled in the user module. code is given below  package moduls import ( "errors&quo

Primitive data type of Golang

Overview In this blog I am going to talk about the date types and variables in go. and the topics bellow  Declaring and initializing variables   explicit initialization of variables   implicit initialization of variables complex data type list of data type Pointer pointer operator dereferencing operator address of operator Constant Iota and constant expression Declaring and initializing variables there are 2 ways you can declarer and initialize a variable they are explicit initialization variables  implicit initialization variables  Explicit initialization of variables  in this way you have to tell the compiler every thing you need to declare a variable. var i int i = 20 var j int = 3 fmt.Println(i,j) var f float32 = 32.233 fmt.Println(f)  in this way we are explicitly telling what will be the input type for that variable. Implicit initialization of variables  in this way of declaring a variable. we don't have to tell the compiler what type of data it will take on that

Functions and Methods of golang

  Overview In this blog i am going to talk about the functions and methods in golang. which is a important topic in go. if you have not read the previous blog or do not have a basic knowledge about go the i would suggest you to have a look at my other blog.  Functions   Methods Functions you can declare a function as below. you don't need to declare return type unless your not returning something from your function. you get the return value in a way that is explained in the example code . func <function name > ( <parameter> <parameter type> ) ( <return type> ){} Example Code : package main import ("fmt") func main() { test1() // example 1 sum := test2() // example 2 fmt.Println("sum =",sum) sum2,error:= test3(30,40) // example 3 fmt.Println("sum 2 =",sum2,error) sum3,_:= test3(80,60) // example 4 fmt.Println("sum 2 =",sum3) su