Skip to content

Instantly share code, notes, and snippets.

View xin053's full-sized avatar
🎯
Focusing

xin053 xin053

🎯
Focusing
View GitHub Profile
@xin053
xin053 / go_net.go
Created September 28, 2022 05:50
[go net]
// 获取 cidr 所有 ip
package main
import (
"net/netip"
)
func Hosts(cidr string) ([]netip.Addr, error) {
prefix, err := netip.ParsePrefix(cidr)
if err != nil {
Still Gathering Statistics...
@xin053
xin053 / 标准库sync.md
Created September 5, 2019 11:54
[go 标准库 sync] go 标准库 sync #go #标准库 #sync
package main

import (
	"bytes"
	"io"
	"os"
	"sync"
@xin053
xin053 / 标准库context.md
Created September 4, 2019 13:38
[go 标准库 context] go 标准库 context #go #标准库 #context

func WithCancel(parent Context) (ctx Context, cancel CancelFunc)

package main

import (
	"context"
	"fmt"
@xin053
xin053 / 标准库exec.md
Last active January 26, 2021 01:20
[go 标准库 os/exec] go 标准库 os/exec #go #标准库 #os/exec

func LookPath(file string) (string, error)

package main

import (
	"fmt"
	"log"
@xin053
xin053 / 标准库filepath.md
Created September 4, 2019 03:42
[go 标准库 path/filepath] go 标准库 path/filepath #go #标准库 #path/filepath

func Ext(path string) string

package main

import (
	"fmt"
	"path/filepath"
@xin053
xin053 / 标准库time.md
Created September 1, 2019 11:57
[go 标准库 time]go 标准库 time #go #标准库 #time

func After(d Duration) <-chan Time

package main

import (
	"fmt"
	"time"
@xin053
xin053 / #标准库sort.md
Created September 1, 2019 08:31
[go 标准库 sort] go 标准库 sort #go #标准库 #sort

func Float64s(a []float64)

package main

import (
	"fmt"
	"math"
@xin053
xin053 / 标准库utf8.md
Created September 1, 2019 07:52
[go 标准库 unicode/utf8] go 标准库 unicode/utf8 #go #标准库 #unicode/utf8

func DecodeLastRune(p []byte) (r rune, size int)

package main

import (
	"fmt"
	"unicode/utf8"
@xin053
xin053 / 标准库regexp.md
Created September 1, 2019 06:58
[go 标准库 regexp] go 标准库 regexp #go #标准库 #regexp