Skip to content

Instantly share code, notes, and snippets.

@ganeshagrawal55
ganeshagrawal55 / todos.go
Created January 17, 2024 13:08
Task Ayush - Todo Rest Service
package main
import (
"encoding/json"
"fmt"
"log"
"math/rand"
"net/http"
"sort"
"strconv"
[
{
"product_id": "00016503-91d5-4803-a465-cab8a69d2f84",
"brand_ref_id": "98f762c4-f223-45de-8bc3-ab3b57c72bc6",
"suggested_retail_price": 22.67,
"suggested_otd_price": 28,
"source": "TREEZ",
"is_master": null,
"category": "FLOWER",
"amount": 3.5,
package main
import "container/heap"
var _ heap.Interface = (*MaxHeap)(nil)
type MaxHeap []int
func (h *MaxHeap) Len() int {
return len(*h)
@ganeshagrawal55
ganeshagrawal55 / main.go
Created March 20, 2023 04:48 — forked from spksoft/main.go
Example Golang worker with rabbitMQ graceful shutdown
package main
import (
"flag"
"log"
"os"
"os/signal"
"syscall"
"time"