Created
June 25, 2018 13:21
-
-
Save ksakae1216/d5ffdae2b8ec956c5ee91bc2146d0e5c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package funcpkg | |
import "fmt" | |
// Tenki 型宣言 | |
type Tenki string | |
// ReceiverFunc レシーバーのサンプルです | |
func ReceiverFunc() { | |
var tk Tenki = "晴れ" | |
tk.receiver() | |
} | |
func (t Tenki) receiver() { | |
str := "あしたは%sです。\n" | |
fmt.Printf(str, t) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment