Skip to content

Commit

Permalink
tomb doesn't need to be pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
barrettj12 committed Jul 26, 2023
1 parent dc3ec38 commit c015637
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions internals/overlord/logstate/gatherer.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ type logGatherer struct {
clientCancel context.CancelFunc

// tomb for the main loop
tomb *tomb.Tomb
tomb tomb.Tomb
}

func newLogGatherer(target *plan.LogTarget) (*logGatherer, error) {
Expand All @@ -75,7 +75,6 @@ func newLogGatherer(target *plan.LogTarget) (*logGatherer, error) {
client: client,
entryCh: make(chan servicelog.Entry),
pullers: map[string]*logPuller{},
tomb: &tomb.Tomb{},
}
g.clientCtx, g.clientCancel = context.WithCancel(context.Background())
g.tomb.Go(g.loop)
Expand Down Expand Up @@ -182,14 +181,13 @@ func (g *logGatherer) stop() {
// main control loop.
type logPuller struct {
iterator servicelog.Iterator
tomb *tomb.Tomb
tomb tomb.Tomb
entryCh chan servicelog.Entry
}

func newLogPuller(entryCh chan servicelog.Entry, buffer *servicelog.RingBuffer) *logPuller {
p := &logPuller{
iterator: buffer.TailIterator(),
tomb: &tomb.Tomb{},
entryCh: entryCh,
}
p.tomb.Go(p.loop)
Expand Down

0 comments on commit c015637

Please sign in to comment.