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


Prompt Examples

ChatGPT Prompt Examples

posted on 2023-06-21 22:37:19 - ChatGPT Tutorials


Use Cases

Chat GPT Key Use Cases

posted on 2023-06-21 21:03:17 - ChatGPT Tutorials


Prompt Frameworks

Prompt Frameworks

posted on 2023-06-21 19:33:06 - ChatGPT Tutorials