Skip to content

Instantly share code, notes, and snippets.

View ParthDesai's full-sized avatar
🏠
Working from home

Parth ParthDesai

🏠
Working from home
View GitHub Profile
@ParthDesai
ParthDesai / generic_demo.go
Last active September 3, 2021 09:54
Generic map function in golang
package main
import (
"fmt"
"reflect"
)
func main() {
r := genericMap([]int{1, 2, 3, 4}, func(x int) string {
return "Hello"
package models
type Channel struct {
UserID string `json:"user_id" bson:"user_id"`
OrganizationID string `json:"org_id" bson:"org_id"`
ApplicationID string `json:"app_id" bson:"app_id"`
ChannelData interface{} `json:"channel_data" bson:"channel_data"`
Ident string `json:"ident" bson:"ident"`
}
@ParthDesai
ParthDesai / net_download
Last active August 29, 2015 14:13
Download http data to file
package main
import (
"bufio"
"net/http"
"os"
"fmt"
)
type Url struct {