From d5c527209f5bd3e106033f1ff7d379d38ae89cf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Mon, 20 Jun 2022 17:21:19 +0200 Subject: [PATCH] Cleanup: rename local var from `compiler` to `service` The `Load()` function returns a `*Service`, and it was confusing that the local variable is named `compiler` instead. Now it's called `service`. No functional changes. --- internal/manager/job_compilers/job_compilers.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/manager/job_compilers/job_compilers.go b/internal/manager/job_compilers/job_compilers.go index a52b8cca..1d7484b8 100644 --- a/internal/manager/job_compilers/job_compilers.go +++ b/internal/manager/job_compilers/job_compilers.go @@ -49,12 +49,12 @@ type TimeService interface { // Load returns a job compiler service with all JS files loaded. func Load(ts TimeService) (*Service, error) { - compiler := Service{ + service := Service{ compilers: map[string]Compiler{}, timeService: ts, } - if err := compiler.loadScripts(); err != nil { + if err := service.loadScripts(); err != nil { return nil, err } @@ -69,12 +69,12 @@ func Load(ts TimeService) (*Service, error) { return content, nil } - compiler.registry = require.NewRegistry(require.WithLoader(staticFileLoader)) - compiler.registry.RegisterNativeModule("author", AuthorModule) - compiler.registry.RegisterNativeModule("path", PathModule) - compiler.registry.RegisterNativeModule("process", ProcessModule) + service.registry = require.NewRegistry(require.WithLoader(staticFileLoader)) + service.registry.RegisterNativeModule("author", AuthorModule) + service.registry.RegisterNativeModule("path", PathModule) + service.registry.RegisterNativeModule("process", ProcessModule) - return &compiler, nil + return &service, nil } func (s *Service) Compile(ctx context.Context, sj api.SubmittedJob) (*AuthoredJob, error) {