Skip to content

Commit

Permalink
refactor: make clean as linter suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Luthfi Fahlevi committed Aug 21, 2024
1 parent 3a01e1b commit ed71b28
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/asset/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ type ServiceDeps struct {
Logger log.Logger
}

func NewService(deps ServiceDeps) (*Service, func()) {
func NewService(deps ServiceDeps) (service *Service, cancel func()) {
assetOpCounter, err := otel.Meter("github.com/goto/compass/core/asset").
Int64Counter("compass.asset.operation")
if err != nil {
otel.Handle(err)
}

service := &Service{
newService := &Service{
assetRepository: deps.AssetRepo,
discoveryRepository: deps.DiscoveryRepo,
lineageRepository: deps.LineageRepo,
Expand All @@ -60,9 +60,9 @@ func NewService(deps ServiceDeps) (*Service, func()) {
assetOpCounter: assetOpCounter,
}

return service, func() {
for i := range service.cancelFnList {
service.cancelFnList[i]()
return newService, func() {
for i := range newService.cancelFnList {
newService.cancelFnList[i]()
}
}
}
Expand Down

0 comments on commit ed71b28

Please sign in to comment.