This file contains hidden or 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 news | |
import "store" | |
type Totaller interface { | |
Subtotal() float64 | |
} | |
type NewsfeedRenderable struct {} |
This file contains hidden or 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 store | |
type Totaller interface { | |
Subtotal() float64 | |
} | |
type Store struct { | |
} | |
func (s *Store) RenderPage(t Totaller) { |
This file contains hidden or 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 store | |
import "cart" | |
type Store struct { | |
} | |
func (s *Store) RenderPage(c *cart.Cart) { | |
// Do thing with total | |
} |
This file contains hidden or 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 cart | |
type Cart struct { | |
} | |
func (c *Cart) Subtotal() float64 { | |
// calculate and return | |
} |
This file contains hidden or 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 customer | |
import "item" | |
type User struct { | |
Name string | |
} | |
type Item => item.Item |
This file contains hidden or 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 cart | |
import "customer" | |
import "item" | |
type Client struct { | |
} | |
func (c *Client) Purchase(who *customer.User, what *item.Item) { | |
} |
This file contains hidden or 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 item | |
type Item struct { | |
Price float64 | |
} |
This file contains hidden or 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 customer | |
type User struct { | |
Name string | |
} |
This file contains hidden or 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 cart | |
import "customer" | |
type Client struct { | |
} | |
func (c *Client) Purchase(who *customer.User, what *customer.Item) { | |
} |
This file contains hidden or 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 customer | |
type User struct { | |
Name string | |
} | |
type Item struct { | |
Price float64 | |
} |