update: item interface discount ratio, add input name
This commit is contained in:
@ -11,7 +11,7 @@ import "fmt"
|
|||||||
|
|
||||||
type item interface {
|
type item interface {
|
||||||
print()
|
print()
|
||||||
discount(float64)
|
discount(ratio float64)
|
||||||
}
|
}
|
||||||
|
|
||||||
type list []item
|
type list []item
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type item interface {
|
type item interface {
|
||||||
discount(float64)
|
discount(ratio float64)
|
||||||
|
|
||||||
// item interface embeds the fmt.Stringer interface.
|
// item interface embeds the fmt.Stringer interface.
|
||||||
//
|
//
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type item interface {
|
type item interface {
|
||||||
discount(float64)
|
discount(ratio float64)
|
||||||
fmt.Stringer
|
fmt.Stringer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type item interface {
|
type item interface {
|
||||||
discount(float64)
|
discount(ratio float64)
|
||||||
fmt.Stringer
|
fmt.Stringer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type item interface {
|
type item interface {
|
||||||
discount(float64)
|
discount(ratio float64)
|
||||||
fmt.Stringer
|
fmt.Stringer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type item interface {
|
type item interface {
|
||||||
discount(float64)
|
discount(ratio float64)
|
||||||
fmt.Stringer
|
fmt.Stringer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type item interface {
|
type item interface {
|
||||||
discount(float64)
|
discount(ratio float64)
|
||||||
fmt.Stringer
|
fmt.Stringer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type item interface {
|
type item interface {
|
||||||
discount(float64)
|
discount(ratio float64)
|
||||||
fmt.Stringer
|
fmt.Stringer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ import (
|
|||||||
|
|
||||||
type item interface {
|
type item interface {
|
||||||
sum() money
|
sum() money
|
||||||
discount(float64)
|
discount(ratio float64)
|
||||||
fmt.Stringer // same as: `String() string`
|
fmt.Stringer // same as: `String() string`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user