go

context-select like features in C++

Imagine a situation where I’d like to call a function that does some amount of processing, but is time-bound. I could write a function in golang using context.Context and select. I’d imagine something as follows:
package main

import (

Unable to read files from folder of a Go package

I am working on this project that generates random names from json files. I have written tests – names\names_test.go and everything passes as expected.
However, if I try to go get github.com/mmuoDev/names-generator this package in another…

Adding InternalServerError fuction

I’m trying to add a function for error handling to my web app and instead of doing this all the time
if err != nil {
http.Error(w, "Internal Server Error", 500)
return
}

do something like this :
ErrorHandler(err)

I made t…

Regular expression at switch case

I need to write a simple telegram bot.
Everything is working except 1 thing. When I’m writing command \task#1 – it should give me the link for it, \task#2 – should give the link to task2, etc.
How to arrange this better or how to make swit…