go 结构体、方法、接口

package main

import "fmt"

func main() {
    type Books struct {
        title   string
        author  string
        subject string
        book_id int
    }
    s := Books{"ask", "jane", "math", 123}
    fmt.Print(s)

}

输出

{ask jane math 123}

你可能感兴趣的:(go 结构体、方法、接口)