Month: July 2021
-
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:…
-
Viewing SQL Logs in MySql
Hi everyone, I’ve recently switched from PostgreSQL and MSSQL to MySQL. I ran into a bit of an issue today where I needed to see the queries I was generating for an insert statement. For MSSQL I’d normally use SQL profiler. After a bit of Googling I came across the following solution for MySQL: Running…
-
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…