9 aillenshen

尚未进行身份认证

暂无相关描述

等级
TA的排名 36w+

golang 小web

golang小web

2016-08-05 14:03:51

golang 上传文件

golanghttp上传文件记录

2016-08-05 13:52:53

oracle 相关sql杂

仅做记录,就自己看看而已

2016-08-05 13:48:17

JAVA intToBytes and bytesToInt

数字存入到字节数组中,和从字节数组中还原数字//注意高低位问题publicstaticintbytesToInt(byte[]src,intoffset){intvalue;value=(int)((src[offset]&0xFF)|((src[offset+1]&0xFF)<<8)|((src[offset+

2016-08-05 10:17:10

golang iota

/**golangiota*/packagemainimport("fmt"_"strconv")varp=fmt.Printlnconst(A=123B)const(C="string"D)const(E=iota*3F)const(G=

2015-04-08 21:24:25

golang jsonrpc

//手动抄写一遍,packagemainimport( "fmt" "log" "net" "net/rpc" "net/rpc/jsonrpc")typeRpcObjstruct{ Idint`json:"id"`//struct标签,如果指定,jsonrpc包会在序列化json时,将该聚合字段命名为指定的字符串 Namestring

2015-04-07 20:08:51

golang rpc tcp

//手动一遍packagemainimport( "net/rpc" "log" "net" "time")typeArgsstruct{ A,Bint}typeArithintfunc(t*Arith)Multiply(args*Args,reply*([]string))error{ *reply=append(*rep

2015-04-07 19:12:42

golang rpc http

//抄袭一遍,练手/**golangnet/rpchttp*/packagemainimport( "errors" "fmt" "log" "net" "net/http" "net/rpc" "time")varp=fmt.PrintlntypeArgsstruct{ A,Bint}typeQuotientstr

2015-04-07 19:10:46

golang udp

/**golangio/ioutil*/packagemainimport( "fmt" "net" "strings" "time")varp=fmt.Printlnfuncserver(){ udpAddr,_:=net.ResolveUDPAddr("udp4","0.0.0.0:7070") conn,e:=net.List

2015-04-04 00:40:10

golang tcp

**golangio/ioutil*/packagemainimport( "fmt" "net" "strings" "time")varp=fmt.Printlnfuncserver(){ tcpAddr,_:=net.ResolveTCPAddr("tcp",":7070") l,e:=net.ListenTCP("tcp",

2015-04-04 00:11:00

Golang goroutine and channel

/**golanggoroutineandchannel*/packagemainimport( "fmt" "os" _"reflect" "runtime/pprof" "time")varp=fmt.Println//-----------------------------------funcmain(){ gofunc(){

2015-03-30 23:43:38

golang interface

/**golanginterface*/packagemainimport( "fmt" _"reflect")varp=fmt.PrintlntypeTestInterfaceinterface{ T()string}typeTestStructstruct{}func(tTestStruct)T()string{

2015-03-30 01:32:19

golang struct

/**golangstruct和指针*/packagemainimport( "fmt" _"strconv" _"time")varp=fmt.Println//这儿就叫结构体了呵呵注意首字母大写的意思和变量函数的意思一样的!typeTeststruct{ //这里面的首字母大小写的意思也是一样的 Aint bint}

2015-03-29 21:34:53

golang 异常处理

/**golangdefer*/packagemainimport( "fmt")varp=fmt.Printlnvarpf=fmt.Printffuncdiv(a,bint)int{ deferfunc(){ //funcrecover()interface{}recover为内建函数 err:=recover(

2015-03-29 17:06:57

golang defer

/**golangdefer*/packagemainimport( "fmt")varp=fmt.Printlnvarpf=fmt.Printffuncmain(){ deferfmt.Println("---------finally------------") p("--------start----------") deferfm

2015-03-29 14:11:06

Golang for if switch

/**golangifforswitch*/packagemainimport( "fmt" "math" "time")varp=fmt.Printlnvarpf=fmt.Printffuncmain(){ //for array:=[]int{1,2,5,5,6} fori:=0;i<len(array

2015-03-29 14:05:37

Golang func

go包里面的变量和函数的首字母大写表示为public的方法或变量/**golangfunc*/packagemainimport("fmt")varp=fmt.Printlnvarpf=fmt.Printf//简单示例funcadd(x,yint)int{returnx+y}funcsub(x,yin

2015-03-29 13:13:06

golang Map

/**数组和切片*/packagemainimport("fmt")varp=fmt.Printlnvarpf=fmt.Printffuncmain(){//初始化strs:=[]string{"123","456"}//range遍历fork,v:=rangestrs{

2015-03-28 18:34:16

golang 数组和切片

/**数组和切片*/packagemainimport("fmt")varp=fmt.Printlnvarpf=fmt.Printffuncmain(){//初始化strs:=[]string{"123","456"}//range遍历fork,v:=rangestrs{

2015-03-28 17:56:12

golang 字符串处理

golang字符串处理packagemainimport("fmt""strconv"//strconv包实现了基本数据类型和其字符串表示的相互转换。s"strings"//对字符串的操作包)//fmt怎么输出字符串参考相关文档varp=fmt.Printlnvarpf=fmt.Printf//入口函数了func

2015-03-28 16:45:45

查看更多

勋章 我的勋章
    暂无奖章