Connecting to SQL Database with Go
The HTML and text templates, discussed in my previous few blog posts, are two of the many packages that become powerful tools when working with large datasets. Henceforth, my next series of blog posts
Search for a command to run...
The HTML and text templates, discussed in my previous few blog posts, are two of the many packages that become powerful tools when working with large datasets. Henceforth, my next series of blog posts
There are many scenarios in which we want to create templates suitable for web applications. It is possible to write HTML templates dynamically using the text/template package, however using html/template makes your HTML templates injection-safe as i...
My previous blog post introduced the feature of actions in templates. Another very similar feature is a function, which can be used together with an action to perform additional operations on the data. For example, {{ range }} is an action as it cont...
My previous blog post introduced templates in Go by demoing how to produce a simple string using the template.New().Parse function. In this blog post, I will go over the steps on how to use the text/template package with loops and conditional logic t...
Using templates in Go is a great way to produce content in a dynamic way. Go makes it possible to prepare content for display as pure text (by using the text/template package or as HTML with proper encoding (by using the html/template package). Both ...
In my two previous blog posts, I wrote about how to create stacks and queues using the struct data type, which is specifically helpful when one wants to define a maximum capacity for the queue/stack. We can also define a maximum capacity for a slice ...
Like a queue, the stack data structure can store objects, allowing the user to add and remove objects from it. In contrast to a queue, a stack uses the “Last In, First out” (LIFO) principle to do this. Similarly to a queue, the best way to implement ...
A queue is a very useful data structure where one can store, add, and remove objects with the “First in, First out” (FIFO) principle. Queues are very useful for basic algorithms (such as bread-first search), so it is therefore worth learning how to i...
A struct is a composite datatype that groups together many fields of different types into one object. This blog post will go over the basics of how to declare a struct and assign values to its attributes. In Go, a struct is defined using the type key...