Skip to content

Instantly share code, notes, and snippets.

View 39Er's full-sized avatar
💯

Weimin Liu 39Er

💯
  • Alibaba
  • Beijing
View GitHub Profile
@39Er
39Er / golang_defer.go
Created March 26, 2021 01:24
golang defer妙用 trace例子
package main
import (
"log"
"time"
)
func main() {
bigSlowOperation()
}
@39Er
39Er / CallConcurrentWithContext.go
Created July 10, 2020 10:06
【golang】并发执行,并支持设置context
package main
import (
"context"
"fmt"
"github.com/pkg/errors"
"reflect"
"sync"
"time"
)
@39Er
39Er / AsyncFuncWithTimeout.go
Last active April 29, 2021 03:21
【golang】超时异步方法(context)
package main
import (
"context"
"fmt"
"github.com/pkg/errors"
"time"
)
var (
@39Er
39Er / etcdclient.go
Created July 25, 2018 11:19
golang etcd api
package main
import (
"time"
"fmt"
"context"
"strconv"
@39Er
39Er / many_senders_many_recievers.go
Last active April 17, 2018 07:38
golang close channel gracefully
package main
import (
"fmt"
"math/rand"
"sync"
"time"
)
const (
@39Er
39Er / timeout.go
Last active April 17, 2018 06:16
golang channel timeout
package concurrency
import (
"fmt"
"time"
)
func ChanTimeout() {
ch := make(chan int)
chClose := make(chan bool)
@39Er
39Er / Makefile
Created March 24, 2018 07:25 — forked from isaacs/Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.