From b53ec04aa3f0b80276527410b25443e468ce4d7e Mon Sep 17 00:00:00 2001 From: Services Bot Date: Wed, 12 Feb 2025 00:26:52 +0000 Subject: [PATCH 1/2] Update Go version to 1.24.0 --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 4de0ecc..6fdee6d 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/UCLALibrary/validation-service -go 1.23.6 +go 1.24.0 require ( github.com/labstack/echo/v4 v4.13.3 From 51f08b429f76dc447513dfd16c0643245a462071 Mon Sep 17 00:00:00 2001 From: angelahuqing Date: Tue, 4 Mar 2025 15:19:25 -0800 Subject: [PATCH 2/2] Update linter version and fix linter issues --- .github/workflows/build.yml | 4 ++-- main.go | 17 +++++++++-------- validation/engine.go | 5 +++-- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6722fb2..21588bd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,8 +2,8 @@ name: Build Docker Image # Defines environmental variables env: - GO_VERSION: '1.23.4' - GO_LINTER_VERSION: 'v1.62.0' + GO_VERSION: '1.24.0' + GO_LINTER_VERSION: 'v1.64.6' # Controls when the action will run on: diff --git a/main.go b/main.go index d790b73..4aa1b1d 100644 --- a/main.go +++ b/main.go @@ -3,13 +3,6 @@ package main import ( "errors" "fmt" - "github.com/UCLALibrary/validation-service/api" - "github.com/UCLALibrary/validation-service/validation" - "github.com/UCLALibrary/validation-service/validation/config" - "github.com/UCLALibrary/validation-service/validation/utils" - "github.com/labstack/echo/v4" - middleware "github.com/oapi-codegen/echo-middleware" - "go.uber.org/zap" "html/template" "io" "log" @@ -17,6 +10,14 @@ import ( "os" "path/filepath" "sync" + + "github.com/UCLALibrary/validation-service/api" + "github.com/UCLALibrary/validation-service/validation" + "github.com/UCLALibrary/validation-service/validation/config" + "github.com/UCLALibrary/validation-service/validation/utils" + "github.com/labstack/echo/v4" + middleware "github.com/oapi-codegen/echo-middleware" + "go.uber.org/zap" ) // Port is the default port for our server @@ -274,7 +275,7 @@ func routerConfigMiddleware(echoApp *echo.Echo, engine *validation.Engine, route // We return the oapi-codegen middleware that handles our OpenAPI defined routes return middleware.OapiRequestValidatorWithOptions(swagger, &middleware.Options{ Skipper: func(aContext echo.Context) bool { - for index, _ := range routes { + for index := range routes { // We ignore paths that we've already configured through static or template handlers if aContext.Path() == routes[index].RoutePath { return true diff --git a/validation/engine.go b/validation/engine.go index 30345fd..1bc09a4 100644 --- a/validation/engine.go +++ b/validation/engine.go @@ -5,11 +5,12 @@ package validation import ( "fmt" + "os" + "github.com/UCLALibrary/validation-service/validation/config" csv "github.com/UCLALibrary/validation-service/validation/utils" "go.uber.org/zap" "go.uber.org/zap/zapcore" - "os" ) // Engine performs the CSV file validations. @@ -129,7 +130,7 @@ func (engine *Engine) Validate(profile string, csvData [][]string) error { // Have each validator check each cell in the supplied csvData for _, validator := range validators { for rowIndex, row := range csvData { - for colIndex, _ := range row { + for colIndex := range row { // Validate the data cell we're on, passing the entire CSV data matrix for additional context err := validator.Validate(profile, csv.Location{RowIndex: rowIndex, ColIndex: colIndex}, csvData) if err != nil {