サンプル
- lengthなどはint
- spirintfでまとめつつStringにしている
package main
import "fmt"
func main() {
type sample struct {
length int
Height int
}
p := new(sample)
p.length = 13
p.Height = 666
str := fmt.Sprintf("長さ:%d 高さ:%d", p.length, p.Height)
fmt.Println(str)
}
結果
長さ:13 高さ:666