Просмотр исходного кода

style: gofmt currency conversion files

Apply gofmt to files touched by the currency conversion port. Fixes
struct-field alignment (Querier/ViewQuerier/CurrencyConverter in
QueryService), import grouping order (pkg/currency alphabetized
before pkg/customcost), and a trailing whitespace introduced by the
original PR.

No behavior change.

Signed-off-by: Warwick Peatey <warwick@automatic.systems>
Assisted-by: Claude Code
Warwick Peatey 1 месяц назад
Родитель
Сommit
4e8e9bfc90

+ 2 - 2
pkg/cloudcost/queryservice.go

@@ -21,8 +21,8 @@ const (
 
 
 // QueryService surfaces endpoints for accessing CloudCost data in raw form or for display in views
 // QueryService surfaces endpoints for accessing CloudCost data in raw form or for display in views
 type QueryService struct {
 type QueryService struct {
-	Querier          Querier
-	ViewQuerier      ViewQuerier
+	Querier           Querier
+	ViewQuerier       ViewQuerier
 	CurrencyConverter currency.Converter
 	CurrencyConverter currency.Converter
 }
 }
 
 

+ 2 - 2
pkg/cmd/costmodel/costmodel.go

@@ -12,8 +12,8 @@ import (
 	"github.com/julienschmidt/httprouter"
 	"github.com/julienschmidt/httprouter"
 	"github.com/opencost/opencost/core/pkg/util/apiutil"
 	"github.com/opencost/opencost/core/pkg/util/apiutil"
 	"github.com/opencost/opencost/pkg/cloudcost"
 	"github.com/opencost/opencost/pkg/cloudcost"
-	"github.com/opencost/opencost/pkg/customcost"
 	"github.com/opencost/opencost/pkg/currency"
 	"github.com/opencost/opencost/pkg/currency"
+	"github.com/opencost/opencost/pkg/customcost"
 	"github.com/prometheus/client_golang/prometheus/promhttp"
 	"github.com/prometheus/client_golang/prometheus/promhttp"
 	"github.com/rs/cors"
 	"github.com/rs/cors"
 
 
@@ -64,7 +64,7 @@ func Execute(conf *Config) error {
 			log.Infof("Currency converter initialized successfully")
 			log.Infof("Currency converter initialized successfully")
 		}
 		}
 	} else {
 	} else {
-		log.Infof("Currency conversion disabled (provider=%s, hasKey=%v)", 
+		log.Infof("Currency conversion disabled (provider=%s, hasKey=%v)",
 			currencyProvider, currencyAPIKey != "")
 			currencyProvider, currencyAPIKey != "")
 	}
 	}
 
 

+ 0 - 1
pkg/costmodel/currency_helper.go

@@ -140,4 +140,3 @@ func ConvertAllocationSetRange(asr *opencost.AllocationSetRange, converter curre
 
 
 	return nil
 	return nil
 }
 }
-

+ 1 - 1
pkg/customcost/queryservice.go

@@ -15,7 +15,7 @@ import (
 const tracerName = "github.com/opencost/opencost/pkg/customcost"
 const tracerName = "github.com/opencost/opencost/pkg/customcost"
 
 
 type QueryService struct {
 type QueryService struct {
-	Querier          Querier
+	Querier           Querier
 	CurrencyConverter currency.Converter
 	CurrencyConverter currency.Converter
 }
 }