Connect and query to a Sqlite database in Golang

First you need to install the go-sqlite3 library downloadable from Github, github.com/mattn/go-sqlite3 Then copy and adapt the code below to your database. package main import ( “fmt” “database/sql” _ “github.com/mattn/go-sqlite3” ) func main() { db,…

Generate random numbers in GoLang

We continue our series on the Go programming language. Today we propose a very useful function to generate random numbers, in this case integers. package main import ( “fmt” “math/rand” “strconv” “time” ) func random(min,…

Connect to a Sql Server database with Go

In this example, let’s see how to connect to Sql Server, select and view the database version using Go programming language. package main import ( _ “github.com/denisenkom/go-mssqldb” “database/sql” “context” “log” “fmt” ) // Replace with…

Go HTTP POST request

With today’s post we return to regularly post on our blog. The first series of posts will be dedicated to the Go programming language. It is a language we highly appreciate and we used it…

Golang – Find all links in a webpage

At dotmaui.com we use Go (Golang), the programming language of Google, more and more often. The dashboard is in fact based on Revel, a high-productivity web framework for the Go language,  and other automation scripts we…

Golang – How to generate a random integer

Small script to generate a random integer, between 1 and 100, in Golang, the Google programming language. package main import ( “fmt” “math/rand” “time” ) func random(min, max int) int { rand.Seed(time.Now().UTC().UnixNano()) return rand.Intn(max-min) +…