update: interfaces

This commit is contained in:
Inanc Gumus
2019-08-19 20:01:02 +03:00
parent b39a9ea117
commit aa7fada2aa
9 changed files with 9 additions and 202 deletions

View File

@ -1,24 +0,0 @@
// For more tutorials: https://blog.learngoprogramming.com
//
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
package main
import "fmt"
type book struct {
title string
price float64
}
func (b book) print() {
fmt.Printf("%-15s: $%.2f \n", b.title, b.price)
}
// TODO: NEW
func (b book) total() float64 {
return b.price
}