上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 52 下一页
摘要: The Go Blog Errors are values 12 January 2015 A common point of discussion among Go programmers, especially those new to the language, is how to handl 阅读全文
posted @ 2016-11-21 10:12 junneyang 阅读(1003) 评论(0) 推荐(0) 编辑
摘要: 唉,只能说C程序员可以接受go的错误设计,相比java来说这个设计真的很差劲! 我认为知乎上说的比较中肯的: 1. The key lesson, however, is that errors are values and the full power of the Go programming 阅读全文
posted @ 2016-11-18 18:53 junneyang 阅读(3038) 评论(0) 推荐(0) 编辑
摘要: 结论: The source command is only available in bash, and the supervisor command is run by sh. I would recommend using a script to perform your commands 代 阅读全文
posted @ 2016-11-18 16:53 junneyang 阅读(6006) 评论(0) 推荐(0) 编辑
摘要: 代码示例 输出结果: 函数当做值和类型在我们写一些通用接口的时候非常有用,通过上面例子我们看到testInt这个类型是一个函数类型,然后两个filter函数的参数和返回值与testInt类型是一样的,但是我们可以实现很多种的逻辑,这样使得我们的程序变得非常的灵活。 阅读全文
posted @ 2016-11-18 11:41 junneyang 阅读(1314) 评论(0) 推荐(0) 编辑
摘要: 结论: 参考资料: https://groups.google.com/forum/#!topic/golang-nuts/LA-cTnKY3cw https://play.golang.org/p/bVP5wPCcQ2 阅读全文
posted @ 2016-11-18 10:57 junneyang 阅读(857) 评论(0) 推荐(0) 编辑
摘要: 先上结论 append新建对象,s2指向了新对象,函数退出新对象释放 原来的s1还是s1,append没有影响,但是s2修改的操作有影响,因为s2直接操作了s1的内存 前言 用过go语言的亲们都知道,slice(中文翻译为切片)在编程中经常用到,它代表变长的序列,序列中每个元素都有相同的类型,类似一 阅读全文
posted @ 2016-11-17 17:50 junneyang 阅读(7731) 评论(2) 推荐(1) 编辑
摘要: Host 目标机器IP.* IdentityFile=/root/.ssh/lan ProxyCommand ssh root@跳板机IP -W %h:%p ServerAliveInterval 30 ControlMaster no ControlPath /tmp/%r@%h-%p.ssh C 阅读全文
posted @ 2016-11-17 14:46 junneyang 阅读(8460) 评论(1) 推荐(0) 编辑
摘要: 大家要如何以规模化方式运维微服务应用程序?实践当中会出现哪些问题,我们又该如何加以解决?在大规模与非预测性工作负载场景当中,我们需要满足哪些条件才能运行一款大型微服务应用程序,而又能够确保不必受到功能发布或者产品变更的影响? 在围绕微服务展开的探讨当中,我们发现几乎很少有人能够切实回答上述问题。以D 阅读全文
posted @ 2016-11-17 11:48 junneyang 阅读(1262) 评论(0) 推荐(0) 编辑
摘要: 代码示例: 结果输出: 参考资料: https://github.com/astaxie/build-web-application-with-golang/blob/master/zh/02.3.md#goto 阅读全文
posted @ 2016-11-17 11:12 junneyang 阅读(28526) 评论(0) 推荐(0) 编辑
摘要: 代码示例: Go中的控制语句较精简,仅有if、for、select和switch。但使用时均比较灵活 if 在Go中条件语句*if*中如果条件部分的计算结果为**true**时将执行语句块,否则则执行else语句块(如果存在else时),此逻辑和其他语言中的if一样,但是在Go中还是有一些不同之处。 阅读全文
posted @ 2016-11-17 10:13 junneyang 阅读(9968) 评论(0) 推荐(0) 编辑
上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 52 下一页