Skip to content

Commit ff0cc79

Browse files
committed
Fix some code styles, extra spaces etc..
Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>
1 parent 751aa02 commit ff0cc79

File tree

18 files changed

+24
-36
lines changed

18 files changed

+24
-36
lines changed

cmd/es-rollover/app/actions_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,5 +121,4 @@ func TestExecuteAction(t *testing.T) {
121121
}
122122
})
123123
}
124-
125124
}

cmd/es-rollover/app/flags.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ func AddFlags(flags *flag.FlagSet) {
5151
flags.Bool(useILM, false, "Use ILM to manage jaeger indices")
5252
flags.String(ilmPolicyName, "", "The name of the ILM policy to use if ILM is active")
5353
flags.Int(timeout, 120, "Number of seconds to wait for master node response")
54-
5554
}
5655

5756
// InitFromViper initializes config from viper.Viper.

cmd/es-rollover/app/index_options_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ func TestRolloverIndices(t *testing.T) {
112112
assert.Equal(t, test.expected[i].readAliasName, r.ReadAliasName())
113113
assert.Equal(t, test.expected[i].writeAliasName, r.WriteAliasName())
114114
assert.Equal(t, test.expected[i].initialRolloverIndex, r.InitialRolloverIndex())
115-
116115
}
117116
})
118117
}

cmd/es-rollover/app/init/action.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ func (c Action) Do() error {
7575
return err
7676
}
7777
}
78-
7978
return nil
8079
}
8180

@@ -129,7 +128,6 @@ func (c Action) init(version uint, indexset app.IndexOption) error {
129128

130129
readAlias := indexset.ReadAliasName()
131130
writeAlias := indexset.WriteAliasName()
132-
133131
aliases := []client.Alias{}
134132

135133
if !filter.AliasExists(jaegerIndices, readAlias) {
@@ -154,6 +152,5 @@ func (c Action) init(version uint, indexset app.IndexOption) error {
154152
return err
155153
}
156154
}
157-
158155
return nil
159156
}

cmd/es-rollover/app/init/flags.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ type Config struct {
3838
func (c *Config) AddFlags(flags *flag.FlagSet) {
3939
flags.Int(shards, 5, "Number of shards")
4040
flags.Int(replicas, 1, "Number of replicas")
41-
4241
}
4342

4443
// InitFromViper initializes config from viper.Viper.

cmd/es-rollover/app/lookback/action.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,16 @@ func (a *Action) Do() error {
4343
}
4444

4545
func (a *Action) lookback(indexSet app.IndexOption) error {
46-
jaegerIndicex, err := a.IndicesClient.GetJaegerIndices(a.Config.IndexPrefix)
46+
jaegerIndex, err := a.IndicesClient.GetJaegerIndices(a.Config.IndexPrefix)
4747
if err != nil {
4848
return err
4949
}
5050

5151
readAliasName := indexSet.ReadAliasName()
52-
readAliasIndices := filter.ByAlias(jaegerIndicex, []string{readAliasName})
52+
readAliasIndices := filter.ByAlias(jaegerIndex, []string{readAliasName})
5353
excludedWriteIndex := filter.ByAliasExclude(readAliasIndices, []string{indexSet.WriteAliasName()})
5454
finalIndices := filter.ByDate(excludedWriteIndex, getTimeReference(timeNow(), a.Unit, a.UnitCount))
55+
5556
if len(finalIndices) == 0 {
5657
return fmt.Errorf("no indices to remove from alias %s", readAliasName)
5758
}
@@ -64,6 +65,6 @@ func (a *Action) lookback(indexSet app.IndexOption) error {
6465
Name: readAliasName,
6566
})
6667
}
67-
return a.IndicesClient.DeleteAlias(aliases)
6868

69+
return a.IndicesClient.DeleteAlias(aliases)
6970
}

cmd/es-rollover/app/lookback/action_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ func TestLookBackAction(t *testing.T) {
7878
config Config
7979
expectedErr error
8080
}{
81-
8281
{
8382
name: "success",
8483
setupCallExpectations: func(indexClient *mocks.MockIndexAPI) {

cmd/es-rollover/app/lookback/flags.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,4 @@ func (c *Config) AddFlags(flags *flag.FlagSet) {
4646
func (c *Config) InitFromViper(v *viper.Viper) {
4747
c.Unit = v.GetString(unit)
4848
c.UnitCount = v.GetInt(unitCount)
49-
5049
}

cmd/es-rollover/app/lookback/time_reference.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,5 @@ func getTimeReference(currentTime time.Time, units string, unitCount int) time.T
3737
year, month, day := currentTime.Date()
3838
return time.Date(year, month, day, 0, 0, 0, 0, currentTime.Location()).AddDate(-1*unitCount, 0, 0)
3939
}
40-
4140
return currentTime.Truncate(time.Second).Add(-time.Duration(unitCount) * time.Second)
42-
4341
}

cmd/es-rollover/app/rollover/action.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ func (a *Action) rollover(indexSet app.IndexOption) error {
5454
if err != nil {
5555
return err
5656
}
57-
jaegerIndicex, err := a.IndicesClient.GetJaegerIndices(a.Config.IndexPrefix)
57+
jaegerIndex, err := a.IndicesClient.GetJaegerIndices(a.Config.IndexPrefix)
5858
if err != nil {
5959
return err
6060
}
6161

62-
indicesWithWriteAlias := filter.ByAlias(jaegerIndicex, []string{writeAlias})
62+
indicesWithWriteAlias := filter.ByAlias(jaegerIndex, []string{writeAlias})
6363
aliases := make([]client.Alias, 0, len(indicesWithWriteAlias))
6464
for _, index := range indicesWithWriteAlias {
6565
aliases = append(aliases, client.Alias{

0 commit comments

Comments
 (0)