Skip to main content

Tag: Url

Detecting MIME Types in Go

Introduction Knowing the type of a file you’re working with is not just a matter of curiosity — it’s often a necessity. This is especially true when you’re deciding whether or not a particular operation can be carried out on that file. Go, with its comprehensive standard library, offers a straightforward approach to identifying a file’s MIME type, ensuring that developers have the tools they need to make informed decisions about file manipulation.

Validating URLs with Go

Introduction In this post, we’ll take a quick look at URL validation using Golang. It’s common to implement URL validation as a task within a HTTP request pipeline, typically as middleware. There are many different definitions of “validation”. For the purpose of this article, we will simply validate that a URL conforms to a particular text pattern. I often see people (mistakenly) use URL and URI interchangeably. URL is actually is a sub-type of URI.