Welcome to Golang -1

This lesson is a introduction of Go language lesson series.

First of all, you have to download golang setup in order to prepare environment.

https://go.dev/dl/

So, start the installation and complete process just clicking 'Next'.



Let's check simple Golang commands;


In the following you will find most common commands.

build -> builds one or more files.

run -> first compiles one or more files and then runs.

fmt -> formats the file.

install -> Install packages.

get -> gets the code as a resource.

test -> runs test packages.

Now, let's install visual studio code as the IDE and introduce Go as an extension.

After we have done our installation, we can add our extension.

After clicking View-> Extension, let's add it as follows.



After successfully installing our extension, let's create our go file. We can create our main.go file by showing an empty folder that we will create in Visual Studio.

Let's fill our file as below.

package main

import "fmt"

func main() {

    fmt.Println("Hello World!")
}


After that, all you have to do is run our file with the "go run main.go" command. We will continue in our next lesson.








 

Yorumlar

Bu blogdaki popüler yayınlar

IONIC BAŞLANGIÇ

Cannot resolve the collation conflict between “Turkish_CI_AS” and “SQL_Latin1_General_CP1_CI_AS” in the equal to operation

Golang working with interfaces and functions -3