Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am allenxuxu on github.
  • I am allenxuxu (https://keybase.io/allenxuxu) on keybase.
  • I have a public key ASAH-zMqfieJTLOP7ZJnbzbccNNQdMaJzLDtxAB2uGHVeAo

To claim this, I am signing this object:

@Allenxuxu
Allenxuxu / go1.16demo.go
Created March 9, 2021 15:20
go 1.16 embed demo
package main
import (
"embed"
"fmt"
"net/http"
"strings"
)
var (
@Allenxuxu
Allenxuxu / tree.go
Created December 25, 2019 11:24
unix tree cmd
package main
import (
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
)
@Allenxuxu
Allenxuxu / signal.go
Created November 21, 2019 13:29
golang 监听信号优雅退出
package main
import (
"log"
"os"
"os/signal"
"syscall"
"time"
)
@Allenxuxu
Allenxuxu / redismq_single_list.go
Created November 21, 2019 13:23
Redis MQ(消费者/生产者模式) 单 list 版本
package redismq
import (
"encoding/json"
"time"
"github.com/go-redis/redis"
)
// RedisMQ Redis list 封装的消费者/生产者模式 先进先出 MQ
@Allenxuxu
Allenxuxu / redismq.go
Created November 7, 2019 06:41
Redis MQ(消费者/生产者模式)
package redismq
import (
"time"
"github.com/go-redis/redis"
)
// RedisMQ Redis list 封装的消费者/生产者模式 先进先出 MQ
type RedisMQ struct {
@Allenxuxu
Allenxuxu / websocket_client.go
Created October 25, 2019 06:35
websocket 吞吐量测试
package main
import (
"flag"
"fmt"
"log"
"math/rand"
"net"
"time"