window 下建立 github 连接
justjavac 发表于 2011-10-02
循环输出 3 篇文章
for post in site.posts limit:3 endfor循环输出最近 3 篇
for post in site.posts offset:3 limit:3 endfor日期
page.date | date:"%B %b, %Y"分页输出...
首先在 GitHub 上建立自己库,例如一个 test 库; 接着在本地建立 test 库的连接:
Set up git git config --global user.name "yourname" git config --global user.email "yourmail"
mkdir Test cd Test git init touch README git add README...
go是函数式编程语言吗?
不是, 当然不是.
那么, go提供函数吗?
是的, 当然, 大多数编程语言都提供函数, go也不例外. 不相信吗? 我会用代码让你闭嘴:
func SayHello() { fmt.Println("Hello") }
看见了吧. go使用关键字func定义函数, 并在函数体中编写函数逻辑.
go函数可以接受参数吗?
嗯, 我又看到一个白痴的问题, 呵呵. 哦, 我懂了, 也许是我的SayHello函数给大家造成了错觉, 我会改造我的代码:
func SayHelloToSomeone(name string) { fmt.Println("Hello " + name + ".") }
函数SayHelloToSomeone接受一个string类型的参数name.
...