Lessons Learned: Golang’s GORM FirstOrCreate

Problem GORM is a great Golang Object Relation Mapper and saved us tons of time when developing CyberSift products. However, there were instances when using the FirstOrCreate function where a new record was simply not created Troubleshooting After creating a simple toy Golang program (shown below) we actually see that the new record IS created, … Continue reading Lessons Learned: Golang’s GORM FirstOrCreate

Lessons Learned: Accepting “any” type of variables in Golang functions

You would like to define a Golang function which accepts different types (or structs) and take different actions depending on your input. This is very similar to the "visitor design pattern"