From 9c7c116650a5ce1451ad8fe7cffd630fff4c30eb Mon Sep 17 00:00:00 2001 From: Tim Raymond Date: Tue, 8 Nov 2016 12:29:29 -0500 Subject: [PATCH] Make argument order of setRandomDefault consistent Most of the other private CRUD methods have a consistent argument order of a context, a source, then a transaction. setRandomDefault had two of these args transposed, so this swaps them to be consistent with the rest of the methods. --- bolt/sources.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bolt/sources.go b/bolt/sources.go index 52a3ca3a0..0f548a823 100644 --- a/bolt/sources.go +++ b/bolt/sources.go @@ -57,7 +57,7 @@ func (s *SourcesStore) Add(ctx context.Context, src chronograf.Source) (chronogr // Delete removes the Source from the SourcesStore func (s *SourcesStore) Delete(ctx context.Context, src chronograf.Source) error { if err := s.client.db.Update(func(tx *bolt.Tx) error { - if err := s.setRandomDefault(ctx, tx, src); err != nil { + if err := s.setRandomDefault(ctx, src, tx); err != nil { return err } return s.delete(ctx, src, tx) @@ -196,7 +196,7 @@ func (s *SourcesStore) resetDefaultSource(ctx context.Context, tx *bolt.Tx) erro // chronograf.Source and set it as the default source. If no other sources are // available, the provided source will be set to the default source if is not // already. It assumes that the provided chronograf.Source has been persisted. -func (s *SourcesStore) setRandomDefault(ctx context.Context, tx *bolt.Tx, src chronograf.Source) error { +func (s *SourcesStore) setRandomDefault(ctx context.Context, src chronograf.Source, tx *bolt.Tx) error { // Check if requested source is the current default if target, err := s.get(ctx, src.ID, tx); err != nil { return err