Skip to content

Commit 39e11da

Browse files
committed
refactor: clean up code
1 parent 45667bf commit 39e11da

8 files changed

Lines changed: 16 additions & 16 deletions

File tree

app/connector/cmd/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ func loadConfig() (*conf.Bootstrap, *bootstrap.Bootstrap, func(), error) {
109109
if err != nil {
110110
return nil, nil, cleanup, err
111111
}
112+
Name = bc.Server.Name
113+
Version = bc.Server.Version
112114

113115
if bc.Server.Mode == constant.Prod {
114116
c, err := loadConsulConfig(bc)
@@ -120,8 +122,6 @@ func loadConfig() (*conf.Bootstrap, *bootstrap.Bootstrap, func(), error) {
120122
return nil, nil, cleanup, err
121123
}
122124

123-
Name = bc.Server.Name
124-
Version = bc.Server.Version
125125
return c, bc, cleanup, nil
126126
}
127127

app/content/cmd/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ func loadConfig() (*conf.Bootstrap, *bootstrap.Bootstrap, func(), error) {
108108
if err != nil {
109109
return nil, nil, cleanup, err
110110
}
111+
Name = bc.Server.Name
112+
Version = bc.Server.Version
111113

112114
if bc.Server.Mode == constant.Prod {
113115
c, err := loadConsulConfig(bc)
@@ -119,8 +121,6 @@ func loadConfig() (*conf.Bootstrap, *bootstrap.Bootstrap, func(), error) {
119121
return nil, nil, cleanup, err
120122
}
121123

122-
Name = bc.Server.Name
123-
Version = bc.Server.Version
124124
return c, bc, cleanup, nil
125125
}
126126

app/gateway/cmd/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ func loadConfig() (*conf.Bootstrap, *bootstrap.Bootstrap, func(), error) {
106106
if err != nil {
107107
return nil, nil, cleanup, err
108108
}
109+
Name = bc.Server.Name
110+
Version = bc.Server.Version
109111

110112
if bc.Server.Mode == constant.Prod {
111113
c, err := loadConsulConfig(bc)
@@ -117,8 +119,6 @@ func loadConfig() (*conf.Bootstrap, *bootstrap.Bootstrap, func(), error) {
117119
return nil, nil, cleanup, err
118120
}
119121

120-
Name = bc.Server.Name
121-
Version = bc.Server.Version
122122
return c, bc, cleanup, nil
123123
}
124124

app/im/cmd/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ func loadConfig() (*conf.Bootstrap, *bootstrap.Bootstrap, func(), error) {
108108
if err != nil {
109109
return nil, nil, cleanup, err
110110
}
111+
Name = bc.Server.Name
112+
Version = bc.Server.Version
111113

112114
if bc.Server.Mode == constant.Prod {
113115
c, err := loadConsulConfig(bc)
@@ -119,8 +121,6 @@ func loadConfig() (*conf.Bootstrap, *bootstrap.Bootstrap, func(), error) {
119121
return nil, nil, cleanup, err
120122
}
121123

122-
Name = bc.Server.Name
123-
Version = bc.Server.Version
124124
return c, bc, cleanup, nil
125125
}
126126

app/infra/cmd/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ func loadConfig() (*conf.Bootstrap, *bootstrap.Bootstrap, func(), error) {
108108
if err != nil {
109109
return nil, nil, cleanup, err
110110
}
111+
Name = bc.Server.Name
112+
Version = bc.Server.Version
111113

112114
if bc.Server.Mode == constant.Prod {
113115
c, err := loadConsulConfig(bc)
@@ -119,8 +121,6 @@ func loadConfig() (*conf.Bootstrap, *bootstrap.Bootstrap, func(), error) {
119121
return nil, nil, cleanup, err
120122
}
121123

122-
Name = bc.Server.Name
123-
Version = bc.Server.Version
124124
return c, bc, cleanup, nil
125125
}
126126

app/notify/cmd/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ func loadConfig() (*conf.Bootstrap, *bootstrap.Bootstrap, func(), error) {
112112
if err != nil {
113113
return nil, nil, cleanup, err
114114
}
115+
Name = bc.Server.Name
116+
Version = bc.Server.Version
115117

116118
if bc.Server.Mode == constant.Prod {
117119
c, err := loadConsulConfig(bc)
@@ -123,8 +125,6 @@ func loadConfig() (*conf.Bootstrap, *bootstrap.Bootstrap, func(), error) {
123125
return nil, nil, cleanup, err
124126
}
125127

126-
Name = bc.Server.Name
127-
Version = bc.Server.Version
128128
return c, bc, cleanup, nil
129129
}
130130

app/signal/cmd/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ func loadConfig() (*conf.Bootstrap, *bootstrap.Bootstrap, func(), error) {
111111
if err != nil {
112112
return nil, nil, cleanup, err
113113
}
114+
Name = bc.Server.Name
115+
Version = bc.Server.Version
114116

115117
if bc.Server.Mode == constant.Prod {
116118
c, err := loadConsulConfig(bc)
@@ -122,8 +124,6 @@ func loadConfig() (*conf.Bootstrap, *bootstrap.Bootstrap, func(), error) {
122124
return nil, nil, cleanup, err
123125
}
124126

125-
Name = bc.Server.Name
126-
Version = bc.Server.Version
127127
return c, bc, cleanup, nil
128128
}
129129

app/user/cmd/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ func loadConfig() (*conf.Bootstrap, *bootstrap.Bootstrap, func(), error) {
108108
if err != nil {
109109
return nil, nil, cleanup, err
110110
}
111+
Name = bc.Server.Name
112+
Version = bc.Server.Version
111113

112114
if bc.Server.Mode == constant.Prod {
113115
c, err := loadConsulConfig(bc)
@@ -119,8 +121,6 @@ func loadConfig() (*conf.Bootstrap, *bootstrap.Bootstrap, func(), error) {
119121
return nil, nil, cleanup, err
120122
}
121123

122-
Name = bc.Server.Name
123-
Version = bc.Server.Version
124124
return c, bc, cleanup, nil
125125
}
126126

0 commit comments

Comments
 (0)