Golang 数值型字符串比较大小

Jackey Golang 9,113 次浏览 0 评论
代码: [codesyntax lang="c"] package main import ( "fmt" ) func main() { var str1 = "2" var str2 = "11" fmt.Println(str1 < str2) str1 = "02" str2 = "11" fmt.Println(str...

go get 使用时的附加参数

Jackey Golang 2,994 次浏览 0 评论
使用 go get 时可以配合附加参数显示更多的信息及实现特殊的下载和安装操作 [table id=2 /]  

Golang 插件式开发

Jackey Golang 5,714 次浏览 0 评论
接口定义: [codesyntax lang="c"] package testPlugin type PluginFunc interface { Hello() World() } type Plugins struct { Plist map[string]PluginFunc } func (p *Plugins) Init() ...

Golang recover捕获panic异常

Jackey Golang 2,622 次浏览 0 评论 , ,
[codesyntax lang="c"] package main import ( "fmt" ) func test() int { defer func() { err := recover() if err != nil { fmt.Println(err) } }() var a int = 10 var b int ...

Golang 闭包最佳实践

Jackey Golang 2,823 次浏览 0 评论 ,
[codesyntax lang="c"] package main import ( "fmt" "strings" ) // 构建闭包,判断传入的 name 是否包含 suffix 后缀,如果不包含,则添加后缀 // 如果包含,则直接返回 name func dealSuffix(su...

Golang 推送消息到 kafka(生产者)

Jackey Golang 4,223 次浏览 2 评论 ,
配置相关依赖包: [codesyntax lang="bash"] mkdir -p $GOPATH/src/golang.org/x cd $GOPATH/src/golang.org/x git clone https://github.com/golang/net.git git clone https://github.com/golang/crypto...

PHP cURL 配置代理及关闭ssl验证

Jackey PHP 4,455 次浏览 1 评论 ,
[codesyntax lang="php"] <?php $content = '提交内容'; $ch = curl_init('https://www.baidu.com'); curl_setopt_array($ch, array( CURLOPT_POST => TRUE, CURLOPT_RETURNTRANSFER => T...

Beego Httplib 设置代理

Jackey Golang 4,596 次浏览 0 评论 ,
[codesyntax lang="c"] package main import ( "fmt" "github.com/astaxie/beego/httplib" "net/http" "net/url" "time" ) func main() { content := "提交内容" req := httplib.Post("htt...

Beego pprof 性能分析工具使用

Jackey Golang 6,635 次浏览 0 评论 ,
router.go 添加内容: [codesyntax lang="c"] beego.Router("/debug/pprof", &controllers.ProfController{}) beego.Router("/debug/pprof/:app([\\w]+)", &controllers.ProfController{}) [/codesyn...
Go