JS Blog Software development, entertainment, lifestyle.

TagGolang

Testing concurrent code in Golang

T

I wrote a package which tracks certain hashtags on twitter and part of the package is adding and removing hashtag from list of hashtags. Plan is that this can be done from different goroutines hence tracking/untracking is done by putting hashtag in channels. It looks like this: var ( trackChan = make(chan string) untrackChan = make(chan string) ) func Track(hs ...string) { for _, h := range hs {...

Table-driven tests are a good stuff

T

In Go there is a great emphasize on writing a table-driven tests. Main goal of these tests is to reduce copy-pasting test skeleton from test to test where only input and expected output are changed. You first define an array of test cases where each test case contains input and expected output. Then you iterate over each one in a loop where you connect test case data with functions you are...

4 best things that happened to me in 2015

4

1. Graduating and obtaining BS in Computer Science. This one is the most important for me. It took me 7 years to get it (2008 – 2015), which is an average. What can I say, I’m an average guy when it comes to this things. For example I also scored an average when graduating from secondary school. And if I would be applying again for faculty, I’d choose the same despite some...

Exporting data as CSV file from web apps (with Golang)

E

While you can certainly export data from javascript with two different ways, they both aren’t good solutions. First one doesn’t allow you to name the downloaded file (it’s just download), second is only supported in Chrome, Firefox and latest version of Microsoft Edge (by the time of writing this post). So the only acceptable option for me is writing a server which accepts POST...

Road so far with me learning Go and what’s next

R

Last week I started to learn Go (Golang) programming language, made by Google. For a first learning resource about the language I picked An introduction to programming in Go, which turned out to be a great starting point in learning this language. As soon as I finished with familiarizing with its basic concepts (types, variables, control structures and functions) I decided to write my first...

JS Blog Software development, entertainment, lifestyle.

About me

Jernej Sila portrait
Hi, I'm Jernej, a software engineer from Slovenia. Welcome to my personal blog. For more about me, my work and hobbies, please visit my profile page.

Categories

Archives