But how does one calculate a seasonal cycle? In this section, we'll be using an algorithm invented in the late 1980s called Seasonal and Trend Decomposition (STL) by LOESS by Cleveland et al. I wrote a library that implements that. You can install it by running go get -u github.com/chewxy/stl.
The library is really small—there is only one main function to call (stl.Dcompose), and the library comes with a litany of features to aid with decomposition of data.
Despite that, I think it would be a good idea to have a rough understanding of the STL algorithm before using it, as usage requires knowledge.