Skip to main content

Posts

Showing posts from November, 2018

Do you support us?

Business address
0x1D24D8f27ea73ff604C7685246bdC6ae55bddaEF

Commands Line Arguments

Today , i will demonstrate how to check command line arguments in GoLang. First of all , you have to answer , why gophers follow gofmt ? You can answer this question below. package main import (               "fmt"                "os" ) func main(){               fmt.Println("command args :" , os.Args[0:]) } import "os"               os is most powerful library in go or you can say a core of go. All the low level operation require os library , such as process Id, chown, mkdir, get environment path or set , threads etc. Concurrency also achieved through os libraries . Upcoming post concurrency discuss in detail.  https://www.golang-book.com/books/intro/10 os.Args[0:]               args[0:] slice the array length . Slicing array length or capacity.  Just to remember, that in case of slice is that how much length programmer want to access.                 Examples:                   C  program we, write this                      

Install go via terminal

Why programmer just like you use terminal instead of G-U-I? Post your answer below , i like terminal because , it help me to understand what application work. First download file from go official website and follow the instruction and make sure environment set properly. open terminal and type  $ go                go command open go shell , now you can run go program, test, check version etc. [$ terminal ready to read ] $go build helloGo.go                 this line compile go program just like c or c++ $./helloGo                now you can want to see your output $go run helloGo.go              this line perform all tasks which build or ./ perform. Tasks such as compile or link the output and also execute the program   $go version               go version print version go version go10.1 linux/amd64

Hello-Go

Google developers create a new programming language called GoLang which can change programmer view totally .  Now a days , Programmer have unleash power . Power that only programmer can understand , why? Because no one , who can play beyond rules. Golang language easy simple and powerful. Don't follow me , follow your heart or explore what you want to do . package main import(           " fmt" ) func main(){                fmt.Println("Hello World ! Go") } package main                     when a programmer write a standalone application in Go. First programmer tells about standalone program or a library. import (             "fmt" )                If you work in c language what this line say, if you don't have . Don't worry . It's tells this program require fmt which is used for output or display message. func         Golang provide a way to write a function . Programmer only need func main         As you know all p