Testing service API and RSpec

Sometimes there is a need to write a small IPA service, often in the form of a prototype. And often this prototype then remains in the originally written form following the principle of "works - do not touch." Rewriting even a relatively small service involves the possibility of making an error or an occasional insignificant change in behavior, which is not immediately apparent. To help here comes testing ...

We write a Telegram-bot on Go to search Wikipedia

We write a Telegram-bot on Go to search WikipediaTable of contents [/b]
Create a bot
We write the code
Expand the bot
Now telegrams are very popular and writing bots for him has become a kind of hello world of our days, therefore, at the thought of what you can write now, many immediately think of writing telegrams for the bot.
As a student, like all students, I often visit Wikipedia in parallel, giving time and a telegram. It was decided to find a way to combine the location in the telegram and the opportunity to find the material I wanted in Wikipedia, in fact, this bot appeared (at the time of writing the bot, I did not ...

Composition of interfaces in Go

One of the most pleasing concepts for me is the ability to composition interfaces. In this article, we will take a look at a small example of using this language feature. To do this, imagine a hypothetical scenario in which two structures process user data and execute http requests.
Ben Johnson .
Perhaps you are curious about the implementation of HTTPClient ?
type (
//wrapper for http requests
HTTPClient struct {
.req * Request
//structure for representing the http request
Request struct {}
//returns the configured HTTPClient
func New (r * Request) * HTTPClient {
return ...

Writing a Telegram bot for Habrahabr

Writing a Telegram bot for HabrahabrIn this article, I want to talk about how the writing of the Telegram bot was done, which could send articles to Habrahabr, first to Python, and then to Go, and what came of it.
was used. pyTelegramBotAPI , for parseing RSS-feeds - feedparser
In the process of working, the structure became much more complicated: now the bot not only sent new articles, but also could filter out those articles that did not contain tags to which the user was subscribed. The implementation was very simple: the SQLite database was used, in which there were only 2 columns (id and tags), good, Python3 had ...