Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

B 20631 upgrade go 1.23.0 nodejs 18.20.4 main #13724

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ version: 2.1

# References for variables shared across the file
references:
circleci-docker: &circleci-docker milmove/circleci-docker:milmove-app-ab729849a08a773ea2557b19b67f378551d1ad3d
circleci-docker: &circleci-docker milmove/circleci-docker:milmove-app-3d9acdaa37c81a87b5fc1c6193a8e528dd56e4ed

# the playwright image to use
playwright: &playwright cimg/node:18.13.0-browsers
Expand All @@ -40,30 +40,30 @@ references:

# In addition, it's common practice to disable acceptance tests and
# ignore tests for dp3 deploys. See the branch settings below.
dp3-branch: &dp3-branch placeholder_branch_name
dp3-branch: &dp3-branch b-20631-upgrade-go-1.23.0-nodejs-18.20.4-main
# MUST BE ONE OF: loadtest, demo, exp.
# These are used to pull in env vars so the spelling matters!
dp3-env: &dp3-env placeholder_env
dp3-env: &dp3-env exp

# set integration-ignore-branch to the branch if you want to IGNORE
# integration tests, or `placeholder_branch_name` if you do want to
# run them
integration-ignore-branch: &integration-ignore-branch placeholder_branch_name
integration-ignore-branch: &integration-ignore-branch b-20631-upgrade-go-1.23.0-nodejs-18.20.4-main

# set integration-mtls-ignore-branch to the branch if you want to
# IGNORE mtls integration tests, or `placeholder_branch_name` if you
# do want to run them
integration-mtls-ignore-branch: &integration-mtls-ignore-branch placeholder_branch_name
integration-mtls-ignore-branch: &integration-mtls-ignore-branch b-20631-upgrade-go-1.23.0-nodejs-18.20.4-main

# set client-ignore-branch to the branch if you want to IGNORE
# client tests, or `placeholder_branch_name` if you do want to run
# them
client-ignore-branch: &client-ignore-branch placeholder_branch_name
client-ignore-branch: &client-ignore-branch b-20631-upgrade-go-1.23.0-nodejs-18.20.4-main

# set server-ignore-branch to the branch if you want to IGNORE
# server tests, or `placeholder_branch_name` if you do want to run
# them
server-ignore-branch: &server-ignore-branch placeholder_branch_name
server-ignore-branch: &server-ignore-branch b-20631-upgrade-go-1.23.0-nodejs-18.20.4-main

executors:
base_small:
Expand Down Expand Up @@ -277,13 +277,13 @@ commands:
- create_dot_go_version
- restore_cache:
keys:
- go-mod-sources-v7-{{ checksum "go.sum" }}-{{ checksum ".go-version" }}
- go-mod-sources-v8-{{ checksum "go.sum" }}-{{ checksum ".go-version" }}

save_cache_for_go:
steps:
- create_dot_go_version
- save_cache:
key: go-mod-sources-v7-{{ checksum "go.sum" }}-{{ checksum ".go-version" }}
key: go-mod-sources-v8-{{ checksum "go.sum" }}-{{ checksum ".go-version" }}
paths:
- '~/go'
- '~/transcom/mymove/bin/swagger'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go-auto-approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: setup go
uses: actions/setup-go@v5
with:
go-version: '1.22.2'
go-version: '1.23.1'
- name: Tidy
run: |
go version
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ repos:
)$

- repo: https://github.com/golangci/golangci-lint
rev: v1.57.2
rev: v1.61.0
hooks:
- id: golangci-lint
entry: bash -c 'exec golangci-lint run ${GOLANGCI_LINT_VERBOSE} -j=${GOLANGCI_LINT_CONCURRENCY:-1}' # custom bash so we can override concurrency for faster dev runs
Expand Down
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
golang 1.22.2
nodejs 18.20.2
golang 1.23.1
nodejs 18.20.4
2 changes: 1 addition & 1 deletion Dockerfile.local
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# BUILDER #
###########

FROM milmove/circleci-docker:milmove-app-ab729849a08a773ea2557b19b67f378551d1ad3d as builder
FROM milmove/circleci-docker:milmove-app-3d9acdaa37c81a87b5fc1c6193a8e528dd56e4ed as builder

ENV CIRCLECI=true

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.migrations_local
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# BUILDER #
###########

FROM milmove/circleci-docker:milmove-app-ab729849a08a773ea2557b19b67f378551d1ad3d as builder
FROM milmove/circleci-docker:milmove-app-3d9acdaa37c81a87b5fc1c6193a8e528dd56e4ed as builder

ENV CIRCLECI=true

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.reviewapp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
###########

# Base builder so the ci build image hash is referenced once
FROM milmove/circleci-docker:milmove-app-ab729849a08a773ea2557b19b67f378551d1ad3d as builder
FROM milmove/circleci-docker:milmove-app-3d9acdaa37c81a87b5fc1c6193a8e528dd56e4ed as builder

ENV CIRCLECI=docker
ENV REACT_APP_NODE_ENV=development
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.tasks_local
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# BUILDER #
###########

FROM milmove/circleci-docker:milmove-app-ab729849a08a773ea2557b19b67f378551d1ad3d as builder
FROM milmove/circleci-docker:milmove-app-3d9acdaa37c81a87b5fc1c6193a8e528dd56e4ed as builder

ENV CIRCLECI=true

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.tools_local
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# BUILDER #
###########

FROM milmove/circleci-docker:milmove-app-ab729849a08a773ea2557b19b67f378551d1ad3d as builder
FROM milmove/circleci-docker:milmove-app-3d9acdaa37c81a87b5fc1c6193a8e528dd56e4ed as builder

ENV CIRCLECI=true

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.webhook_client
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# BUILDER #
###########

FROM milmove/circleci-docker:milmove-app-ab729849a08a773ea2557b19b67f378551d1ad3d as builder
FROM milmove/circleci-docker:milmove-app-3d9acdaa37c81a87b5fc1c6193a8e528dd56e4ed as builder

# Prepare public DOD certificates.
# hadolint ignore=DL3002
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.webhook_client_dp3
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# BUILDER #
###########

FROM milmove/circleci-docker:milmove-app-ab729849a08a773ea2557b19b67f378551d1ad3d as builder
FROM milmove/circleci-docker:milmove-app-3d9acdaa37c81a87b5fc1c6193a8e528dd56e4ed as builder

# Prepare public DOD certificates.
# hadolint ignore=DL3002
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.webhook_client_local
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# BUILDER #
###########

FROM milmove/circleci-docker:milmove-app-ab729849a08a773ea2557b19b67f378551d1ad3d as builder
FROM milmove/circleci-docker:milmove-app-3d9acdaa37c81a87b5fc1c6193a8e528dd56e4ed as builder

# Prepare public DOD certificates.
# hadolint ignore=DL3002
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ build_tools: bin/gin \
build: server_build build_tools client_build ## Build the server, tools, and client

.PHONY: mocks_generate
mocks_generate: bin/mockery ## Generate mockery mocks for tests
mocks_generate: bin/mockery ## Generate mockery mocks for tests.
go generate $$(go list ./... | grep -v \\/pkg\\/gen\\/ | grep -v \\/cmd\\/)

.PHONY: server_test_setup
Expand Down Expand Up @@ -1057,7 +1057,7 @@ pretty: gofmt ## Run code through JS and Golang formatters

.PHONY: docker_circleci
docker_circleci: ## Run CircleCI container locally with project mounted
docker run -it --pull=always --rm=true -v $(PWD):$(PWD) -w $(PWD) -e CIRCLECI=1 milmove/circleci-docker:milmove-app-ab729849a08a773ea2557b19b67f378551d1ad3d bash
docker run -it --pull=always --rm=true -v $(PWD):$(PWD) -w $(PWD) -e CIRCLECI=1 milmove/circleci-docker:milmove-app-3d9acdaa37c81a87b5fc1c6193a8e528dd56e4ed bash

.PHONY: docker_local_ssh_server_with_password
docker_local_ssh_server_with_password:
Expand Down
2 changes: 1 addition & 1 deletion cmd/ghc-pricing-parser/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ func summarizeModel(appCtx appcontext.AppContext, header string, modelInstance i
if err != nil {
return err
}
pterm.Printf(pterm.Gray("(representative rows above; " + pterm.Green(length) + " rows total)\n\n"))
pterm.Printf(pterm.Gray("(representative rows above; %s rows total)\n\n"), pterm.Green(length))

return nil
}
Expand Down
12 changes: 8 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
module github.com/transcom/mymove

go 1.22
go 1.23

// Temporary workaroudn to mockery alias generation issue with go 1.23
// found at https://github.com/vektra/mockery/issues/803
godebug gotypesalias=0

require (
github.com/DATA-DOG/go-txdb v0.1.7
Expand Down Expand Up @@ -71,7 +75,7 @@ require (
github.com/tcnksm/go-input v0.0.0-20180404061846-548a7d7a8ee8
github.com/tealeg/xlsx/v3 v3.3.7
github.com/tiaguinho/gosoap v1.4.4
github.com/vektra/mockery/v2 v2.33.2
github.com/vektra/mockery/v2 v2.45.1
github.com/xuri/excelize/v2 v2.8.1
go.flipt.io/flipt/rpc/flipt v1.45.0
go.flipt.io/flipt/sdk/go v0.5.0
Expand Down Expand Up @@ -148,7 +152,7 @@ require (
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.7 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/brunoscheufler/aws-ecs-metadata-go v0.0.0-20221221133751-67e37ae746cd // indirect
github.com/chigopher/pathlib v1.0.0 // indirect
github.com/chigopher/pathlib v0.19.1 // indirect
github.com/codegangsta/envy v0.0.0-20141216192214-4b78388c8ce4 // indirect
github.com/containerd/console v1.0.3 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
Expand Down Expand Up @@ -192,7 +196,7 @@ require (
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hhrutter/lzw v1.0.0 // indirect
github.com/hhrutter/tiff v1.0.1 // indirect
github.com/huandu/xstrings v1.3.3 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/iancoleman/strcase v0.2.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
Expand Down
11 changes: 6 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ github.com/brunoscheufler/aws-ecs-metadata-go v0.0.0-20221221133751-67e37ae746cd
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/chigopher/pathlib v1.0.0 h1:SbsCrFX4vDf4M2d8mT/RTzuVlKOjTKoPHK0HidsQFak=
github.com/chigopher/pathlib v1.0.0/go.mod h1:3+YPPV21mU9vyw8Mjp+F33CyCfE6iOzinpiqBcccv7I=
github.com/chigopher/pathlib v0.19.1 h1:RoLlUJc0CqBGwq239cilyhxPNLXTK+HXoASGyGznx5A=
github.com/chigopher/pathlib v0.19.1/go.mod h1:tzC1dZLW8o33UQpWkNkhvPwL5n4yyFRFm/jL1YGWFvY=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I=
Expand Down Expand Up @@ -313,8 +313,9 @@ github.com/hhrutter/lzw v1.0.0 h1:laL89Llp86W3rRs83LvKbwYRx6INE8gDn0XNb1oXtm0=
github.com/hhrutter/lzw v1.0.0/go.mod h1:2HC6DJSn/n6iAZfgM3Pg+cP1KxeWc3ezG8bBqW5+WEo=
github.com/hhrutter/tiff v1.0.1 h1:MIus8caHU5U6823gx7C6jrfoEvfSTGtEFRiM8/LOzC0=
github.com/hhrutter/tiff v1.0.1/go.mod h1:zU/dNgDm0cMIa8y8YwcYBeuEEveI4B0owqHyiPpJPHc=
github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4=
github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU=
github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0=
github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
Expand Down Expand Up @@ -632,8 +633,8 @@ github.com/toqueteos/webbrowser v1.2.0 h1:tVP/gpK69Fx+qMJKsLE7TD8LuGWPnEV71wBN9r
github.com/toqueteos/webbrowser v1.2.0/go.mod h1:XWoZq4cyp9WeUeak7w7LXRUQf1F1ATJMir8RTqb4ayM=
github.com/urfave/cli v1.22.10 h1:p8Fspmz3iTctJstry1PYS3HVdllxnEzTEsgIgtxTrCk=
github.com/urfave/cli v1.22.10/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/vektra/mockery/v2 v2.33.2 h1:znIUwQ3FxnA5jvPy8irYBoiIqMZhuOJhoPOJYNoTJqU=
github.com/vektra/mockery/v2 v2.33.2/go.mod h1:9lREs4VEeQiUS3rizYQx1saxHu2JiIhThP0q9+fDegM=
github.com/vektra/mockery/v2 v2.45.1 h1:6HpdnKiLCjVtzlRLQPUNIM0u7yrvAoZ7VWF1TltJvTM=
github.com/vektra/mockery/v2 v2.45.1/go.mod h1:XNTE9RIu3deGAGQRVjP1VZxGpQNm0YedZx4oDs3prr8=
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=
Expand Down
4 changes: 2 additions & 2 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ buildEnv {
(import
(builtins.fetchGit {
# Descriptive name to make the store path easier to identify
name = "go-1.22.2";
name = "go-1.23.1";
url = "https://github.com/NixOS/nixpkgs/";
ref = "refs/heads/nixpkgs-unstable";
rev = "dfcffbd74fd6f0419370d8240e445252a39f4d10";
})
{ }).go_1_22_2
{ }).go_1_23_1

(import
(builtins.fetchGit {
Expand Down
6 changes: 3 additions & 3 deletions pkg/apperror/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func NewInvalidInputError(id uuid.UUID, err error, validationErrors *validate.Er

func (e InvalidInputError) Error() string {
if e.message != "" {
return fmt.Sprintf(e.message)
return e.message
} else if e.id == uuid.Nil && e.ValidationErrors != nil {
return fmt.Sprintf("Invalid input received. %s", e.ValidationErrors)
} else if e.ValidationErrors != nil {
Expand All @@ -244,7 +244,7 @@ type QueryError struct {

func (e QueryError) Error() string {
if e.message != "" {
return fmt.Sprintf(e.message)
return e.message
}
return fmt.Sprintf("Could not complete query related to object of type: %s.", e.objectType)
}
Expand Down Expand Up @@ -281,7 +281,7 @@ func NewInvalidCreateInputError(validationErrors *validate.Errors, message strin

func (e InvalidCreateInputError) Error() string {
if e.message != "" {
return fmt.Sprintf(e.message)
return e.message
}
return fmt.Sprintf("Invalid input for ID: %s", e.ValidationErrors)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/handlers/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func ServeCustomError(rw http.ResponseWriter, r *http.Request, err error) {
default:
rw.WriteHeader(http.StatusInternalServerError)
if r == nil || r.Method != http.MethodHead {
_, _ = rw.Write(errorAsJSON(openapierrors.New(http.StatusInternalServerError, err.Error()), traceID))
_, _ = rw.Write(errorAsJSON(openapierrors.New(http.StatusInternalServerError, "%s", err.Error()), traceID))
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions pkg/handlers/ghcapi/internal/payloads/model_to_payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ func Order(order *models.Order) *ghcmessages.Order {

var moveCode string
var moveTaskOrderID strfmt.UUID
if order.Moves != nil && len(order.Moves) > 0 {
if len(order.Moves) > 0 {
moveCode = order.Moves[0].Locator
moveTaskOrderID = strfmt.UUID(order.Moves[0].ID.String())
}
Expand Down Expand Up @@ -1413,7 +1413,7 @@ func MTOShipment(storer storage.FileStorer, mtoShipment *models.MTOShipment, sit
payload.SitDaysAllowance = handlers.FmtIntPtrToInt64(&totalSITAllowance)
}

if mtoShipment.SITDurationUpdates != nil && len(mtoShipment.SITDurationUpdates) > 0 {
if len(mtoShipment.SITDurationUpdates) > 0 {
payload.SitExtensions = *SITDurationUpdates(&mtoShipment.SITDurationUpdates)
}

Expand Down Expand Up @@ -1535,7 +1535,7 @@ func PaymentRequests(appCtx appcontext.AppContext, prs *models.PaymentRequests,
func PaymentRequest(appCtx appcontext.AppContext, pr *models.PaymentRequest, storer storage.FileStorer) (*ghcmessages.PaymentRequest, error) {
serviceDocs := make(ghcmessages.ProofOfServiceDocs, len(pr.ProofOfServiceDocs))

if pr.ProofOfServiceDocs != nil && len(pr.ProofOfServiceDocs) > 0 {
if len(pr.ProofOfServiceDocs) > 0 {
for i, proofOfService := range pr.ProofOfServiceDocs {
payload, err := ProofOfServiceDoc(proofOfService, storer)
if err != nil {
Expand Down Expand Up @@ -1680,7 +1680,7 @@ func ServiceRequestDoc(serviceRequest models.ServiceRequestDocument, storer stor

uploads := make([]*ghcmessages.Upload, len(serviceRequest.ServiceRequestDocumentUploads))

if serviceRequest.ServiceRequestDocumentUploads != nil && len(serviceRequest.ServiceRequestDocumentUploads) > 0 {
if len(serviceRequest.ServiceRequestDocumentUploads) > 0 {
for i, serviceRequestUpload := range serviceRequest.ServiceRequestDocumentUploads {
url, err := storer.PresignedURL(serviceRequestUpload.Upload.StorageKey, serviceRequestUpload.Upload.ContentType)
if err != nil {
Expand Down Expand Up @@ -1728,7 +1728,7 @@ func MTOServiceItemModel(s *models.MTOServiceItem, storer storage.FileStorer) *g

serviceRequestDocs := make(ghcmessages.ServiceRequestDocuments, len(s.ServiceRequestDocuments))

if s.ServiceRequestDocuments != nil && len(s.ServiceRequestDocuments) > 0 {
if len(s.ServiceRequestDocuments) > 0 {
for i, serviceRequest := range s.ServiceRequestDocuments {
payload, err := ServiceRequestDoc(serviceRequest, storer)
if err != nil {
Expand Down Expand Up @@ -1917,7 +1917,7 @@ func WeightTicketUpload(storer storage.FileStorer, upload models.Upload, url str
func ProofOfServiceDoc(proofOfService models.ProofOfServiceDoc, storer storage.FileStorer) (*ghcmessages.ProofOfServiceDoc, error) {

uploads := make([]*ghcmessages.Upload, len(proofOfService.PrimeUploads))
if proofOfService.PrimeUploads != nil && len(proofOfService.PrimeUploads) > 0 {
if len(proofOfService.PrimeUploads) > 0 {
for i, primeUpload := range proofOfService.PrimeUploads {
url, err := storer.PresignedURL(primeUpload.Upload.StorageKey, primeUpload.Upload.ContentType)
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions pkg/handlers/primeapi/payloads/model_to_payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ func MTOAgents(mtoAgents *models.MTOAgents) *primemessages.MTOAgents {

func ProofOfServiceDoc(proofOfServiceDoc models.ProofOfServiceDoc) *primemessages.ProofOfServiceDoc {
uploads := make([]*primemessages.UploadWithOmissions, len(proofOfServiceDoc.PrimeUploads))
if proofOfServiceDoc.PrimeUploads != nil && len(proofOfServiceDoc.PrimeUploads) > 0 {
if len(proofOfServiceDoc.PrimeUploads) > 0 {
for i, primeUpload := range proofOfServiceDoc.PrimeUploads {
uploads[i] = basicUpload(&primeUpload.Upload) //#nosec G601
}
Expand All @@ -333,7 +333,7 @@ func PaymentRequest(paymentRequest *models.PaymentRequest) *primemessages.Paymen

serviceDocs := make(primemessages.ProofOfServiceDocs, len(paymentRequest.ProofOfServiceDocs))

if paymentRequest.ProofOfServiceDocs != nil && len(paymentRequest.ProofOfServiceDocs) > 0 {
if len(paymentRequest.ProofOfServiceDocs) > 0 {
for i, proofOfService := range paymentRequest.ProofOfServiceDocs {
serviceDocs[i] = ProofOfServiceDoc(proofOfService)
}
Expand Down Expand Up @@ -445,7 +445,7 @@ func PaymentServiceItemParams(paymentServiceItemParams *models.PaymentServiceIte
//nolint:gosec //G601
func ServiceRequestDocument(serviceRequestDocument models.ServiceRequestDocument) *primemessages.ServiceRequestDocument {
uploads := make([]*primemessages.UploadWithOmissions, len(serviceRequestDocument.ServiceRequestDocumentUploads))
if serviceRequestDocument.ServiceRequestDocumentUploads != nil && len(serviceRequestDocument.ServiceRequestDocumentUploads) > 0 {
if len(serviceRequestDocument.ServiceRequestDocumentUploads) > 0 {
for i, proofOfServiceDocumentUpload := range serviceRequestDocument.ServiceRequestDocumentUploads {
uploads[i] = basicUpload(&proofOfServiceDocumentUpload.Upload)
}
Expand Down Expand Up @@ -705,7 +705,7 @@ func MTOServiceItem(mtoServiceItem *models.MTOServiceItem) primemessages.MTOServ

serviceRequestDocuments := make(primemessages.ServiceRequestDocuments, len(mtoServiceItem.ServiceRequestDocuments))

if mtoServiceItem.ServiceRequestDocuments != nil && len(mtoServiceItem.ServiceRequestDocuments) > 0 {
if len(mtoServiceItem.ServiceRequestDocuments) > 0 {
for i, serviceRequestDocument := range mtoServiceItem.ServiceRequestDocuments {
serviceRequestDocuments[i] = ServiceRequestDocument(serviceRequestDocument)
}
Expand Down
Loading
Loading