You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

func.go 410 B

3 years ago
123456789101112131415161718192021222324
  1. package main
  2. import "fmt"
  3. type Publisher struct {
  4. name string
  5. address string
  6. }
  7. type Book struct {
  8. title, name string
  9. publisher Publisher
  10. }
  11. func main() {
  12. var book = Book{"title","name",Publisher{"pub","beijing"}}
  13. /* 这是我的第一个简单的程序 */
  14. fmt.Println("Hello, World!")
  15. fmt.Println(book)
  16. }
  17. func test (book Book) (b1 Book, b2 Book){
  18. return book,book
  19. }