Formatting Float Values

We all need to format float numbers before displaying them to users. In Golang we can use the FormatFloat() method in strconv package Here is a brief overview of how to use FormatFloat() func FormatFloat(f float64, fmt byte, prec, bitSize int) string FormatFloat() accepts 4 parameters and returns formatted number as string. The first parameter […]

Continue reading →

Going Async with Channels and go routines

One of the early Feedback received for Social Paster has been that people wanted Login with Facebook functionality. And Heeding the feedback, I have started working on it. Login with Facebook functionality required me to integrate Facebook’s javascript SDK. After user logs in and authenticates the app, I receive a short lived access token and […]

Continue reading →

Sending Emails from Revel App

Sending emails is a very important functionality for any web app. Go provides an inbuilt net/smtp package. Sending emails is straight forward and simple. However, if you are using Revel, it provides a mail package which is an abstraction over the net/smtp package and makes you lazier. Lets explore Revel’s mail package a bit. We […]

Continue reading →

Adding pagination to Revel app

Very often, we need pagination support on our data, to make it convenient for user to browse through it. Unfortunately, there is no in-built support for pagination in revel, but its not hard to build one of your own. For pagination to work, we need 3 things Total number of data elements (totalCount) Number of […]

Continue reading →