Files

23 lines
555 B
Go
Raw Permalink Normal View History

2019-08-17 15:55:25 +03:00
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
2019-10-30 19:34:44 +03:00
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
2019-08-17 15:55:25 +03:00
package main
2019-08-19 10:21:11 +03:00
import "fmt"
2019-08-17 15:55:25 +03:00
2019-08-19 10:21:11 +03:00
type puzzle struct {
title string
2019-08-21 23:53:47 +03:00
price money
2019-08-19 10:21:11 +03:00
}
2019-08-17 15:55:25 +03:00
2019-08-23 17:07:45 +03:00
// if you remove this method,
// you can no longer add it to the `store` in `main()`.
2019-08-19 10:21:11 +03:00
func (p puzzle) print() {
2019-08-21 23:53:47 +03:00
fmt.Printf("%-15s: %s\n", p.title, p.price.string())
2019-08-17 15:55:25 +03:00
}