Go
_Rick_
fighting。。。。。
展开
-
基于Golang的Class文件解析工具
分享一下之前写的Class 文件解析的工具。 Gom:https://github.com/LavGo/gom go get -u github.com/LavGo/gom go install github.com/LavGo/gom gom Xjre="ClassFile path"原创 2020-07-06 14:56:18 · 483 阅读 · 0 评论 -
Go CopyFile 异常处理 实现
Go,CopyFile 实现 + 异常处理原创 2015-11-27 14:11:08 · 775 阅读 · 0 评论 -
Go的异常处理 defer, panic, recover
Go语言追求简洁优雅,所以,Go语言不支持传统的 try…catch…finally 这种异常,因为Go语言的设计者们认为,将异常与控制结构混在一起会很容易使得代码变得混乱。因为开发者很容易滥用异常,甚至一个小小的错误都抛出一个异常。在Go语言中,使用多值返回来返回错误。不要用异常代替错误,更不要用来控制流程。在极个别的情况下,也就是说,遇到真正的异常的情况下(比如除数为0了)。才使用Go中引入的转载 2015-11-27 14:05:39 · 867 阅读 · 0 评论 -
Go 并发编程基础(一)goroutine,channel
package mainimport ( "fmt" )func sum(values []int, resultChan chan int) { sum := 0 for _, value := range values { sum += value } resultChan <- sum //将运算结果写到channel中原创 2016-03-19 14:31:42 · 682 阅读 · 0 评论 -
Http原理实践 Go实现
package mainimport ( "bytes" "fmt" "io" "net" "os" )func main() { if len(os.Args) != 2 { fmt.Fprintf(os.Stderr, "Usage : %s host:post", os.Args[0]) os.Exit(1)原创 2016-03-19 15:21:35 · 580 阅读 · 0 评论 -
Beego安装 Mac linux
1.beego下载go get github.com/astaxie/beegogit https 无法获取git config --global http.sslVerify false2.beego 升级go get -u github.com/astaxie/beego go install github.com/astaxie/beego bee工具安装 export GOPATH=your原创 2016-03-12 21:15:46 · 2144 阅读 · 0 评论 -
Golang strings 包 用法详解
package mainimport ( "fmt" "strings" //"unicode/utf8" )func main() { fmt.Println("查找子串是否在指定的字符串中") fmt.Println(" Contains 函数的用法") fmt.Println(strings.Contains("seafood", "foo"))转载 2016-05-05 14:04:52 · 5202 阅读 · 1 评论 -
Golang RPC
Server.gopackage mainimport ( "fmt" "net/rpc" "net" "log" "sync" )type Arg struct { Param1 string } type Request struct{ Arg1 int Arg2 string Arg3 *Arg} type Respons原创 2017-01-06 03:49:59 · 509 阅读 · 0 评论