Skip to content

Instantly share code, notes, and snippets.

View schwarzeni's full-sized avatar
📚
good good study, day day up

schwarzeni

📚
good good study, day day up
View GitHub Profile
@schwarzeni
schwarzeni / lb.go
Last active January 26, 2021 08:53
一个简单的拥有 LoadBalance 的生产者消费者代码
package main
import (
"context"
"errors"
"fmt"
"log"
"math/rand"
"sync"
"time"
@schwarzeni
schwarzeni / util.go
Last active July 3, 2024 21:50
[golang] get specific network interface's IPv4 address
package util
import (
"errors"
"fmt"
"net"
)
// useful links:
// https://stackoverflow.com/questions/27410764/dial-with-a-specific-address-interface-golang