Martini 中文交流群
371440803,欢迎加入哈...阅读全文
371440803,欢迎加入哈...阅读全文
``` /** 批量文件重命名,替换文件名 王参加 2018-03-08 23:00 */ package main import ( "flag" "fmt" "os" "path/filepath" "strings" ) func main() { // 解析命令行参数 var dir string flag.StringVar(&dir, "d", "", "要替换的目录物理路径,如:/tmp/go/") var oldstr string flag.StringVar(&oldstr, "o", "", "要替换的字符:例如:替换 .php 或者 .inc.") var newstr string ...阅读全文
 为进一步支持开源事业,七牛推出了“七牛开源项目扶持计划”,免费支持开源项目,为开源事业尽一份力量。 如果您建有开源项目站,或者参与了其他开源项目站的维护,您就可以申请加入“七牛开源项目扶持计划”。 **申请步骤如下:**  同时,我们特别推出了“说出你最喜欢的开源项目,七牛和你一起去支持!”活动,只要是你喜欢的开源项目,七牛就会和你一起去支持!我们还会在每个月的第一个星期一从参与该活动的开发者中随机抽取3个幸运开发者,各送出七牛周边礼品1份。 了解...阅读全文
 这是在main 添加,这种方式有什么错误吗...阅读全文
参考文档:http://www.runoob.com/go/go-constants.html ``` package main import ( //fmt这样的内部函数库 编辑器会自动加上。不需要我们手动,除非是复制其他的外部代码 "fmt" "unsafe" ) //定义在外面的常量 const abc string = "aaa" const ( a="abc" b = len(a) c = unsafe.Sizeof(a) ) func main() { //可以重复定义,不会报错 const abc string = "bbb" //编译器可以根据变量的值来推断类型 const dd = "dd" fm...阅读全文
Telegram GoLnag 中文 爱好者群组 本着互相帮助的原则建立本群组,有使用电报的爱好者可以加入. https://t.me/GoFan...阅读全文
### 安装下载软件需要翻墙 将文件下载到: ``` /usr/local ``` mac下载,然后上传: 官网下载:https://golang.org/ ``` wget https://dl.google.com/go/go1.10.linux-amd64.tar.gz scp go1.10.linux-amd64.tar.gz root@10.10.21.97:/usr/local ``` ``` mkdir /usr/local/go tar -C /usr/local -xzf go1.10.linux-amd64.tar.gz ``` 添加环境变量: ``` vi /etc/profile 添加一行 ex...阅读全文
``` package main //go 语言控制结构 import ( "fmt" "math" ) const ( name string = `sunlong` age int = 10 height int = 180 ) func main() { //fmt.Print( name ) //var age int = 10; //使用函数 control_if() var score = control_switch(20) fmt.Print( "\r\n 你的结果是:" ,score ) control_for() } func control_if(...阅读全文
"bytes" log.Printf("[%2x] data:[%2x]", this.command_buffer, data) this.command_buffer.Reset() this.command_buffer.Write(left_bytes) this.command_buffer.Write(data) this.command_buffer.Write(right_bytes) log.Printf("[%2x]", this.command_buffer) this.command_pos += len(data) 2017/05/15 16:31:34 left_bytes:[...阅读全文