首页 > 其他 > 详细

方法的调用,管道的演示

时间:2019-11-02 14:06:46      阅读:71      评论:0      收藏:0      [点我收藏+]
package main
import(
	"fmt"
)
//变量 名字 类型
func add(a int, b int) int {
	var sum int
	sum = a + b
	return sum
}
func main() {
	//调用
	var c int 
	c = add(100, 200)
	fmt.Println("hello world==add=", c)
}

  

package main
import(
	"fmt"
)
func test_pipe() {
	// 管道
	pipe := make(chan int,3)
	pipe <- 1
	pipe <- 2
	pipe <- 3
	fmt.Println(len(pipe))
}
// func main() {
// 	test_pipe ()
// 	//调用
// }

  

方法的调用,管道的演示

原文:https://www.cnblogs.com/fdxjava/p/11781463.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!