Check out example codes for "how to count the rows returned by a query context go". It will help you in understanding the concepts better.

Code Example 1

var count int

err := db.QueryRow("SELECT COUNT(*) FROM main_table").Scan(&count)
switch {    
case err != nil:
    log.Fatal(err)
default:
    fmt.Printf("Number of rows are %s\n", count)
}

Learn ReactJs, React Native from akashmittal.com