Skip to content

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesReate committed Sep 19, 2024
1 parent 1454291 commit f1a185b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions internal/api/vehicle_template_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package api

import (
"context"

"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

Expand Down
9 changes: 5 additions & 4 deletions internal/controllers/device_config_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import (
"encoding/binary"
"encoding/json"
"fmt"
"github.com/volatiletech/sqlboiler/v4/queries/qm"
"io"
"strings"
"time"

"github.com/volatiletech/sqlboiler/v4/queries/qm"

"github.com/DIMO-Network/shared/db"
"github.com/DIMO-Network/vehicle-signal-decoding/internal/core/queries"

Expand Down Expand Up @@ -272,9 +273,9 @@ func (d *DeviceConfigController) GetDBCFileByTemplateName(c *fiber.Ctx) error {
return fiber.NewError(fiber.StatusInternalServerError, err.Error())
}
// string append each dbc file
var dbcFileStrings []string
for _, dbcFile := range dbcFiles {
dbcFileStrings = append(dbcFileStrings, dbcFile.DBCFile)
var dbcFileStrings = make([]string, len(dbcFiles))
for i, dbcFile := range dbcFiles {
dbcFileStrings[i] = dbcFile.DBCFile
}
dbResult := strings.Join(dbcFileStrings, "\n")

Expand Down
3 changes: 3 additions & 0 deletions internal/core/queries/get_pid_config_all.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ type GetPidsQueryRequest struct {
// GetPidsByTemplate gets all pids in a template and their children from inherited parent templates
func GetPidsByTemplate(ctx context.Context, dbs func() *db.ReaderWriter, request *GetPidsQueryRequest) (models.PidConfigSlice, *models.Template, error) {
templateNames, template, err := GetAllParentTemplates(ctx, dbs, request.TemplateName)
if err != nil {
return nil, nil, err
}

pidConfigs, err := models.PidConfigs(
qm.WhereIn("template_name IN ?", ToAnySlice(templateNames)...),
Expand Down

0 comments on commit f1a185b

Please sign in to comment.