-
Installation through Go Get command
$ go get github.com/migopsrepos/gotsql
-
Initialize the GoTSQL object
import "github.com/migopsrepos/gotsql" ... g := gotsql.GoTSQL{}
-
Load the template file or directory with template files. (Templates are discussed in detail in next section)
g.Load("library/") ... g.Load("library_dev/")
-
Get the query using namespace and use it in Golang
query, err := g.Get("library/books/crud/getAllBooks", nil) ... rows, err := db.Query(query, ...)
You can find the usage and more examples in this article