Skip to content

Instantly share code, notes, and snippets.

@ksakae1216
Created June 25, 2018 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ksakae1216/d5ffdae2b8ec956c5ee91bc2146d0e5c to your computer and use it in GitHub Desktop.
Save ksakae1216/d5ffdae2b8ec956c5ee91bc2146d0e5c to your computer and use it in GitHub Desktop.
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