Skip to content

Commit

Permalink
Avoid embedding: Fix code samples (#106)
Browse files Browse the repository at this point in the history
Remove return clauses from methods that don't return anything and don't
use a pointer to an interface.

Co-authored-by: Abhinav Gupta <mail@abhinavg.net>
  • Loading branch information
xxjwxc and abhinav authored Dec 2, 2020
1 parent dc02530 commit e460299
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions style.md
Original file line number Diff line number Diff line change
Expand Up @@ -1335,12 +1335,12 @@ type ConcreteList struct {

// Add adds an entity to the list.
func (l *ConcreteList) Add(e Entity) {
return l.list.Add(e)
l.list.Add(e)
}

// Remove removes an entity from the list.
func (l *ConcreteList) Remove(e Entity) {
return l.list.Remove(e)
l.list.Remove(e)
}
```

Expand Down Expand Up @@ -1390,17 +1390,17 @@ type ConcreteList struct {
```go
// ConcreteList is a list of entities.
type ConcreteList struct {
list *AbstractList
list AbstractList
}

// Add adds an entity to the list.
func (l *ConcreteList) Add(e Entity) {
return l.list.Add(e)
l.list.Add(e)
}

// Remove removes an entity from the list.
func (l *ConcreteList) Remove(e Entity) {
return l.list.Remove(e)
l.list.Remove(e)
}
```

Expand Down

0 comments on commit e460299

Please sign in to comment.