In this post we’ll have a look at how to build a MySQL backed API with Go and echo. This is part of the series that explains how we did photographerexcuses.com
The site is a Vue.js single page app, that gets its data (the excuses) from the Go API. We are storing the excuses in MySQL, because we can easily edit them at the same time with MySQL workbench or similar tools that don’t require flat files, git or other methods that would be more annoying to deal with.
Continue reading “Building a Go(lang) API with echo and MySQL”
This was confusing to me at first, because in basically every language I knew I could change the length of an array by just
pushing things to it. Not so; in Go.
Continue reading “Golang: Arrays of Strings”
In this post we’re going to have a look at how to have a close look at HTTP requests processed by Go and how to prevent automatic redirection through
302 or similar redirects. This is useful both for investigating tracking links from twitter, buffer, bit.ly or email marketing, or to make sure your tools to generate them actually work 😉 For a demo, check out the Redirect Checker Tool
Continue reading “Tracing or Preventing HTTP Redirects in Golang”
The framework I’m using is superior to yours!
discussions en masse.
I just want to give a quick overview of what I think of the matter, because many people have some good points, but my TLDR; version would be: do whatever you want, but don’t tell other people what they should do.
Continue reading “On: Too many Frameworks and if you should use one”
Web scraping is practically parsing the HTML output of a website and taking the parts you want to use for something. In theory, that’s a big part of how Google works as a search engine. It goes to every web page it can find and stores a copy locally.
For this tutorial, you should have go installed and ready to go, as in, your
$GOPATH set and the required compiler installed.
Continue reading “Web Scraping with Golang and goQuery”
Checkup is a siteuptime like alternative that will monitor the response times of your website and a bunch of other things.
Setting up the project is a little tricky if you’re new to go, but if you read the Readme and google the error messages you get, you should be perfectly fine.
You can clone the most recent version from their github repository and run it with:
go run cmd/checkup/main.go --store
Using the checkup fs provider
Sadly the documentation is not super awesome yet, but I quickly diffed the changes I made to make the project use the local storage provider instead of relying on aws s3.
Continue reading “Using Sourcegraph Checkup with local file system storage”
Since I’ve recently started dabbling with Go again, of course I had to install it on my machines that mostly run Linux Mint. One of the usual ways for me to install software through the PPAs was apparently not maintained since a couple of releases ago, but on a ubuntu forum thread I found godeb, which is a small binary command line tool that lets you install your desired version of Go!
Continue reading “Installing Go on Ubuntu / Debian / Linux Mint with godeb”
Parsing JSON is a common task for most developers, currently I’m actually finally getting to write slugofy which is supposed to slugify URLs or URL fragments in Go.
In case you’re wondering, slugs are commonly used to generate URLs from the title of a page. Let’s say we have a page title like the Swedish national dish:
Swedish national dish: köttbullar, we probably don’t want either the special chars like the ö or the : in there. Also we don’t want whitespaces to show up as
%20, so let’s make them dashes instead:
Continue reading “JSON parsing in Golang”
Unit testing with Go-lang is very simple and the
testing library is actually included by default. For test driven development or just for covering the functionality of your code afterwards, unit tests are pretty essential.
This article is about the smallest possible effort we can make to get started with testing. No fancy algorithms or too language specific things, just the bare minimum, so we understand what’s going on and can extend from there on.
Continue reading “Go(lang) Unit Testing for Absolute Beginners”
Go is a C-like language and initially developed at Google, it has caught my attention by some members of the node.js and web development community giving it a shot and also some interesting looking projects. You can check it out at golang.org. Continue reading “Taking a stab at the Go Language and file permissions”