官方:http://golang.org ,好吧,经常被封
中文手册的翻译:http://code.google.com/p/golang-china
嗯,还有一个:http://zh-golang.appsp0t.com/,这个不是appspot哦,中间那是0,不过appspot.com也能看,只是。。。这又是一个墙外站。
还有几个:
1、这也是别人的学习笔记:http://www.cnblogs.com/yjf512/category/385369.html
2、某牛的网站:http://www.mikespook.com/
最后说几个编辑器:
1、liteIDE,跨平台,会教你怎么安装:http://code.google.com/p/golangide/
2、Intellij CE,可以装go的插件,但我没装好。。。
3、Sublime Text2,支持go
小笔记:
XML/HTML代码
- func test141() {
- a := "this is string"
- t := strings.Count(a,"") -1; //???why :before & after each rune
- var s = make([]string,t);
-
- fmt.Println(t);
- for i,v :=range a{
- s[t-i-1] = string(v);
- fmt.Println(i,string(v));
- }
- }
最初的时候,我是
var s = []string{};
然后在设置的时候,告诉我 out of range,嗯,一定要设置一下s的长度
为什么上面的t要减1,还有下面的s[t-i-1]?
主要就是那段英文,官方文档里说了:。。。before & after each rune;
比如 字符串:test,那么长度不是4,而是5,这和PHP中不一样。。。要记住。。。
字符串反转还有方法是:
XML/HTML代码
- func test142() {
- a := "this is string"
- var result string;
- for _,v := range a{ // _是用来占位,但不作运算而是抛弃的变量。
- result = string(v)+result;
- }
- fmt.Println(result);
- }
这个比较简单。。