株式会社ヴァンデミックシステム

Blog

<スポンサーリンク>

サンプル

  • 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

<スポンサーリンク>

コメントを残す

Allowed tags:  you may use these HTML tags and attributes: <a href="">, <strong>, <em>, <h1>, <h2>, <h3>
Please note:  all comments go through moderation.

*

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)