Tag: golang

  • Golang and MySQL – DigitalOcean managed cluster

    Hey everyone, Just sharing a helper function to get you started when trying to connect to a mysql managed cluster on DigitalOcean with Golang. Before we get into the code you’ll need to grab a couple of things from the database dashboard (on DigitalOcean). Open the databases tab Look for the “Connection Details” section Download…

  • failed to connect to the database: default addr for network unknown – MySql and Golang

    Hey everyone, I’m currently setting up a mysql database on DigitalOcean and hit the following error when connecting: failed to connect to the database: default addr for “DATABASE_CONN_STR” network unknown Luckily this turned out to be a pretty easy fix. In the mysql driver repo you can see that the only scenario where this error…

  • No matches for kind “Deployment” in version “apps/v1beta2” – DigitalOcean

    Hey everyone, I’ve been working on a small golang app and decided to try out Kubernetes on DigitalOcean instead of the usual Azure or AWS. In order to get started I followed the tutorial at this link: https://www.digitalocean.com/community/tutorials/webinar-series-a-closer-look-at-kubernetes I ran into a small issue while trying to using the provided deployment.yaml. error: unable to recognize…

  • Create a pre-signed upload url for AWS S3 using Golang

    Hi everyone, This is just a quick post on how to create a pre-signed upload url for AWS S3 using Golang. The generate the presigned url, you’ll need something like the following: Note that we’re using godotenv to load AWS environment variables containing a few AWS keys. You can get godotenv by running the following:…

  • Avoiding “declared but not used” in Golang while testing

    Hi everyone, I come from a mostly JavaScript and .NET background and am currently transitioning to Golang. I’m really liking the language and ecosystem so far but one thing that has irked me a little is that I can’t leave variables as placeholders or even for debugging. Something as simple as the above results in…

Create a website or blog at WordPress.com