自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

JieLinDee的专栏

天道酬勤,厚积薄发.对Go语言有兴趣的朋友可以加:259693140(已满),858980110(02群),进群不允许

  • 博客(9)
  • 收藏
  • 关注

原创 Go语言监控文件变化小程序.

package mainimport ( "log" "github.com/go-fsnotify/fsnotify")func main() { watcher, err := fsnotify.NewWatcher() if err != nil { log.Fatal(err) } defer watcher.Close() done := make(chan

2015-09-29 16:41:23 7502

原创 Go语言自己实现的异步小log程序.

slog.gopackage slogimport ( "errors" "fmt" "os" "strings" "time")type Logger struct { console bool warn bool info bool tformat func() string file chan string}func NewLog(l

2015-09-28 11:47:19 2639 1

原创 Go语言简单实现FTP协议.

package ftpimport ( "errors" "fmt" "io" "net" "os" "strconv" "strings")type Ftp struct { con net.Conn ip string}func NewFtp(ip string) (*Ftp, error) { buf := make([]byte, 1024) con

2015-09-24 13:13:42 5240 4

原创 GO1.5.1使用ssh,与Linux交互.带终端

package mainimport ( "golang.org/x/crypto/ssh" "log" "os")type Rw struct{}func main() { client("root", "123456", "127.0.0.1:5506")}func client(user, passwd, ip string) { config := &ssh.C

2015-09-14 13:09:25 3483 2

原创 Go1.5从文件读取密码,然后到远端下载文件的小实例.(通过sftp协议下载)

package mainimport ( "bufio" "fmt" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/agent" "io" "log" "net" "os" "path/filepath" "regexp" "sftp" "strings")func main() { if len(os.A

2015-09-11 11:40:05 1223

原创 go-xorm使用mssql的小实例

package mainimport ( "fmt" "os" "time" "github.com/go-xorm/core" "github.com/go-xorm/xorm" _ "github.com/lunny/godbc")type NxServerState struct { ID int `xorm:"pk not nu

2015-09-07 11:49:40 3919

原创 godbc中使用mssql的小实例

package xormimport ( "database/sql" "testing" _ "github.com/lunny/godbc")const mssqlConnStr = "driver={SQL Server};Server=192.168.20.135;Database=xorm_test; uid=sa; pwd=1234;"func newMssqlE

2015-09-07 08:40:30 1066

原创 go1.5 动态密码,最简单的实现使用hmac加密

package mainimport ( "crypto/md5" "fmt" "strconv" "strings" "time")func main() { for i := 0; i < 20; i++ { M := md5.New() M.Write([]byte(fmt.Sprint(time.Now().Unix() - (time.Now().Unix(

2015-09-02 15:11:43 2355

原创 Go语言fmt.Printf的使用

Fmt包import "fmt"简介 ▾Package fmt包含有格式化I/O函数,类似于C语言的printf和scanf。格式字符串的规则来源于C但更简单一些。输出格式:一般:%v 基本格式的值。当输出结构体时,扩展标志(%+v)添加成员的名字。the value in a default format. when printing structs,

2015-09-02 13:33:30 5684

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除