Skip to content

Commit

Permalink
golangci-lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ofaurax committed Feb 3, 2025
1 parent a59385e commit 8fe94e7
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 39 deletions.
4 changes: 1 addition & 3 deletions cmd/collect/inventory.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ import (
"log"

"github.com/google/uuid"

coapiv1 "github.com/metal-toolbox/conditionorc/pkg/api/v1/conditions/types"
rctypes "github.com/metal-toolbox/rivets/v2/condition"

mctl "github.com/metal-toolbox/mctl/cmd"
"github.com/metal-toolbox/mctl/internal/app"
rctypes "github.com/metal-toolbox/rivets/v2/condition"
"github.com/spf13/cobra"
)

Expand Down
4 changes: 1 addition & 3 deletions cmd/collect/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ import (
"log"

"github.com/google/uuid"

rctypes "github.com/metal-toolbox/rivets/v2/condition"

mctl "github.com/metal-toolbox/mctl/cmd"
"github.com/metal-toolbox/mctl/internal/app"
rctypes "github.com/metal-toolbox/rivets/v2/condition"
"github.com/spf13/cobra"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ func VendorModelFromAttrs(attrs []fleetdbapi.Attributes) (vendor, model string)
//
//nolint:whitespace // you have stupid opinions, be silent
func FirmwareSetIDByVendorModel(ctx context.Context, vendor, model string,
client *fleetdbapi.Client) (uuid.UUID, error) {

client *fleetdbapi.Client,
) (uuid.UUID, error) {
params := &fleetdbapi.ComponentFirmwareSetListParams{
Vendor: strings.TrimSpace(vendor),
Model: strings.TrimSpace(model),
Expand Down
1 change: 0 additions & 1 deletion cmd/create/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"log"

coapiv1 "github.com/metal-toolbox/conditionorc/pkg/api/v1/conditions/types"

mctl "github.com/metal-toolbox/mctl/cmd"
"github.com/metal-toolbox/mctl/internal/app"
"github.com/spf13/cobra"
Expand Down
7 changes: 3 additions & 4 deletions cmd/get/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ import (
"github.com/dustin/go-humanize"
"github.com/google/uuid"
fleetdbapi "github.com/metal-toolbox/fleetdb/pkg/api/v1"
mctl "github.com/metal-toolbox/mctl/cmd"
"github.com/metal-toolbox/mctl/internal/app"
"github.com/metal-toolbox/mctl/internal/fleetdb"
rt "github.com/metal-toolbox/rivets/v2/types"
"github.com/olekukonko/tablewriter"
"github.com/pkg/errors"
"github.com/spf13/cobra"

mctl "github.com/metal-toolbox/mctl/cmd"
"github.com/metal-toolbox/mctl/internal/app"
"github.com/metal-toolbox/mctl/internal/fleetdb"
)

type getServerFlags struct {
Expand Down
3 changes: 1 addition & 2 deletions cmd/install/firmware_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ import (
fleetdbapi "github.com/metal-toolbox/fleetdb/pkg/api/v1"
mctl "github.com/metal-toolbox/mctl/cmd"
"github.com/metal-toolbox/mctl/internal/app"
rctypes "github.com/metal-toolbox/rivets/v2/condition"
"github.com/pkg/errors"
"github.com/spf13/cobra"

rctypes "github.com/metal-toolbox/rivets/v2/condition"
)

type installFirmwareSetFlags struct {
Expand Down
5 changes: 2 additions & 3 deletions cmd/install/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import (
"log"

"github.com/google/uuid"
rctypes "github.com/metal-toolbox/rivets/v2/condition"
"github.com/spf13/cobra"

mctl "github.com/metal-toolbox/mctl/cmd"
"github.com/metal-toolbox/mctl/internal/app"
rctypes "github.com/metal-toolbox/rivets/v2/condition"
"github.com/spf13/cobra"
)

var serverIDStr string
Expand Down
3 changes: 1 addition & 2 deletions cmd/list/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ import (

fleetdbapi "github.com/metal-toolbox/fleetdb/pkg/api/v1"
mctl "github.com/metal-toolbox/mctl/cmd"
"github.com/spf13/cobra"

"github.com/metal-toolbox/mctl/internal/app"
"github.com/metal-toolbox/mctl/internal/fleetdb"
"github.com/spf13/cobra"
)

type listComponentFlags struct {
Expand Down
4 changes: 1 addition & 3 deletions cmd/list/firmware_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ type listFirmwareSetFlags struct {
labels map[string]string
}

var (
flags *listFirmwareSetFlags
)
var flags *listFirmwareSetFlags

// var flagsDefinedListFwSet *listFirmwareSetFlags

Expand Down
7 changes: 3 additions & 4 deletions cmd/list/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ import (
"strings"

fleetdbapi "github.com/metal-toolbox/fleetdb/pkg/api/v1"
rt "github.com/metal-toolbox/rivets/v2/types"
"github.com/olekukonko/tablewriter"
"github.com/spf13/cobra"

mctl "github.com/metal-toolbox/mctl/cmd"
"github.com/metal-toolbox/mctl/internal/app"
"github.com/metal-toolbox/mctl/internal/fleetdb"
rt "github.com/metal-toolbox/rivets/v2/types"
"github.com/olekukonko/tablewriter"
"github.com/spf13/cobra"
)

type listServerFlags struct {
Expand Down
9 changes: 4 additions & 5 deletions cmd/power/power.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@ import (
"encoding/json"
"fmt"
"log"
"slices"
"strings"

"github.com/google/uuid"
coclient "github.com/metal-toolbox/conditionorc/pkg/api/v1/conditions/client"
coapiv1 "github.com/metal-toolbox/conditionorc/pkg/api/v1/conditions/types"
mctl "github.com/metal-toolbox/mctl/cmd"
"github.com/metal-toolbox/mctl/internal/app"
rctypes "github.com/metal-toolbox/rivets/v2/condition"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"golang.org/x/exp/slices"

coclient "github.com/metal-toolbox/conditionorc/pkg/api/v1/conditions/client"
coapiv1 "github.com/metal-toolbox/conditionorc/pkg/api/v1/conditions/types"
rctypes "github.com/metal-toolbox/rivets/v2/condition"
)

var powerCmd = &cobra.Command{
Expand Down
9 changes: 3 additions & 6 deletions cmd/validate_firmware.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,16 @@ import (

"github.com/google/uuid"
"github.com/metal-toolbox/conditionorc/pkg/api/v1/conditions/types"
"github.com/spf13/cobra"

"github.com/metal-toolbox/mctl/internal/app"
"github.com/spf13/cobra"
)

type validationFlags struct {
srvIDStr, fwSetIDStr, output string
}

var (
// incoming command line parameters
fwvFlags = &validationFlags{}
)
// incoming command line parameters
var fwvFlags = &validationFlags{}

var validateFirmwareCmd = &cobra.Command{
Use: "validate-firmware",
Expand Down
2 changes: 1 addition & 1 deletion internal/fleetdb/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ type ComponentCommonAttributes struct {
SmartErrors []string `json:"smart_errors,omitempty"`
PowerCapacityWatts int64 `json:"power_capacity_watts,omitempty"`
SizeBytes int64 `json:"size_bytes,omitempty"`
CapacityBytes int64 `json:"capacity_bytes,omitempty" diff:"immutable"`
CapacityBytes int64 `diff:"immutable" json:"capacity_bytes,omitempty"`
ClockSpeedHz int64 `json:"clock_speed_hz,omitempty"`
Cores int `json:"cores,omitempty"`
Threads int `json:"threads,omitempty"`
Expand Down

0 comments on commit 8fe94e7

Please sign in to comment.