riss

mail@pastecode.io avatar
unknown
golang
2 years ago
388 B
1
Indexable
Never
func GetUSers(c *gin.Context) {
	rows, err := db_client.DBClient.Queryx("SELECT top 2 * FROM users")
	if err != nil {
		fmt.Println(err.Error())
		return
	}
	for rows.Next() {
		m := map[string]interface{}{}
		err := rows.MapScan(m)
		if err != nil {
			fmt.Println(err.Error())
			return
		}

		fmt.Println(m) // iki kate tak dadino c.json
	}
	// c.JSON(http.StatusOK)
}