Skip to content

Instantly share code, notes, and snippets.

View haozibi's full-sized avatar
🍩
coding

haozibi haozibi

🍩
coding
View GitHub Profile
@haozibi
haozibi / golang-function-anonymous.go
Last active June 3, 2020 11:17
range 与 闭包的使用,Go词法作用域陷阱,捕获迭代变量 -- gopl 5.6.1
package main
import (
"fmt"
"sync"
)
var list = [...]int{1, 2, 3, 4, 5}
func main() {
@asukakenji
asukakenji / 0-go-os-arch.md
Last active June 27, 2024 13:32
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
@wendal
wendal / exists.go
Last active April 1, 2020 13:05
golang判断文件是否存在
func PathExist(_path string) bool {
_, err := os.Stat(_path)
if err != nil && err.Error() == os.ErrNotExist.Error() {
return false
}
return true
}
// golang新版本的应该
func PathExist(_path string) bool {