// week1 project main.go //导入一个包(目录)package main//导入方法import "fmt" //createMessage函数(参数,类型)返回值的类型(这里是string),这里可以返回多个类型func create(name string)(string, int){........} func createMessage (name string) string { //如果name长度小于0 if len(name) == 0 { return "Hello world" } else { return "Hello " + name }} //如果函数main,必须要从main开始。func main() { //打印结果 fmt.Println(createMessage("zhangs")) fmt.Println(createMessage("lisi")) fmt.Println(createMessage(""))}