This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"fmt" | |
"net" | |
"sync" | |
"github.com/fvbock/endless" | |
"github.com/gin-gonic/gin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"sync/atomic" | |
) | |
var b = 1 | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test | |
import ( | |
"fmt" | |
"strconv" | |
"testing" | |
) | |
const ( | |
str = "abc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
// by haozibi | |
// https://play.golang.org/p/QiQ4sBoVbCu | |
// | |
// 参考: | |
// https://segmentfault.com/a/1190000018464029 | |
// https://github.com/golang/sync/tree/master/singleflight | |
// https://github.com/golang/groupcache/tree/master/singleflight |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
var list = [...]int{1, 2, 3, 4, 5} | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
// https://play.golang.org/p/jooMMwYID54 | |
// 一个简单的协程池 | |
// 关键问题是:range 读取 closed retCh 时才不会报错 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
fmt.Println("hello") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |