Skip to content

Commit

Permalink
more nits
Browse files Browse the repository at this point in the history
  • Loading branch information
woodsaj authored and tomwilkie committed Feb 5, 2019
1 parent ceb9205 commit 4582c43
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 1 addition & 7 deletions pkg/loki/loki.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,12 @@ type Loki struct {
store chunk.Store

httpAuthMiddleware middleware.Interface

inited map[moduleName]struct{}
}

// New makes a new Loki.
func New(cfg Config) (*Loki, error) {
loki := &Loki{
cfg: cfg,
inited: map[moduleName]struct{}{},
cfg: cfg,
}

loki.setupAuthMiddleware()
Expand Down Expand Up @@ -128,8 +125,6 @@ func (t *Loki) initModule(m moduleName) error {
return errors.Wrap(err, fmt.Sprintf("error initialising module: %s", m))
}
}

t.inited[m] = struct{}{}
return nil
}

Expand Down Expand Up @@ -161,5 +156,4 @@ func (t *Loki) stopModule(m moduleName) {
level.Error(util.Logger).Log("msg", "error stopping", "module", m, "err", err)
}
}
delete(t.inited, m)
}
2 changes: 1 addition & 1 deletion pkg/loki/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func orderedDeps(m moduleName) []moduleName {
uniq[dep] = false
}

result := make([]moduleName, 0)
result := make([]moduleName, 0, len(uniq))

// keep looping through all modules until they have all been added to the result.

Expand Down

0 comments on commit 4582c43

Please sign in to comment.