You can easily check if a key exists in a go map by using the ok result: value, ok := myMap[key] Or in an one line check: if val, ok := myMap[key]; ok { // do something }
You can easily check if a key exists in a go map by using the ok result: value, ok := myMap[key] Or in an one line check: if val, ok := myMap[key]; ok { // do something }
If you work with weeknummers, you can find the weeknumber of a date with the Golang function time.ISOWeek. However you wish to get the first date of a week, there is no such function in Google Go. So let's write it our selfs: func FirstDayOfISOWeek(year int, week int, timezone *time.Location) time.Time { date := time.Date(year, 0, […]
Google Go is an excelent language for building (compiled) web applications. We could start building a Golang web application from scratch, but like with other languages you can start off faster with an existing framework. I have tried several diffent frameworks, but many of them are still inmature and often lack documentation. The best and […]