Go lang
Modules
Create a Go module
Create app using Go Module
Programs
read csv file
find variable type in golang
for loops in golang
MongoDB sort() Method
MongoDB Find
MongoDB FindOne
differences between arrays and slices
InsertOne MongoDB
Connecting to MongoDB
how to use range in golang
Install
Installing GO lang

Create a Go Module



create a folder for the Go module, as below



mkdir mymodule
cd mymodule


Issue the Create Module command in terminal as following, here "github.com/freedomtutorials/mymodule" is the name of the module which we are going to create, you can replace with your module name


go mod init github.com/freedomtutorials/mymodule

the file go.mod will be created and the below output will be produced


$ go mod init github.com/freedomtutorials/mymodule
go: creating new go.mod: module github.com/freedomtutorials/mymodule

In Go, if a function name starts with a capital letter will be available to be called by a function from same package or other package. This is known in Go as an exported name.


create a file mymodule.go in the current folder, and open in text editor paste the following code into mymodule.go and save the file



package mymodule

import "fmt"

func MyFunc(name string) string {
    message := fmt.Sprintf("Hello, %v. Welcome!", name)
    return message
}



how to use range in golang

how to use range in golang

posted on 2022-05-03 08:28:11 - Go lang Tutorials


find variable type in golang

find variable type in golang

posted on 2022-05-03 05:24:55 - Go lang Tutorials


for loops in golang

for loops in golang

posted on 2022-05-03 04:27:40 - Go lang Tutorials


Run MongoDB On WSL Ubuntu

Run MongoDB On WSL Ubuntu

posted on 2022-04-28 05:02:09 - mongodb Tutorials


Installing MongoDB

Installing MongoDB

posted on 2022-04-28 04:16:57 - mongodb Tutorials


MySQL TRIGGERS

MySQL - Triggers

posted on 2019-11-29 21:44:07 - mysql Tutorials