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

Make linter happy #1947

Merged
merged 1 commit into from
Feb 9, 2024
Merged
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
4 changes: 2 additions & 2 deletions cmd/build-disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ func NewBuildDisk(root *cobra.Command, addCheckRoot bool) *cobra.Command {
Use: "build-disk image",
Short: "Build a disk image using the given image (experimental and subject to change)",
Args: cobra.ExactArgs(0),
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(_ *cobra.Command, _ []string) error {
if addCheckRoot {
return CheckRoot()
}
return nil
},
RunE: func(cmd *cobra.Command, args []string) (err error) {
RunE: func(cmd *cobra.Command, _ []string) (err error) {
var cfg *v1.BuildConfig
var spec *v1.DiskSpec

Expand Down
2 changes: 1 addition & 1 deletion cmd/build-iso.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func NewBuildISO(root *cobra.Command, addCheckRoot bool) *cobra.Command {
" * <sourceType> - might be [\"dir\", \"file\", \"oci\", \"docker\", \"channel\"], as default is \"docker\"\n" +
" * <sourceName> - is path to file or directory, image name with tag version or channel name",
Args: cobra.MaximumNArgs(1),
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(_ *cobra.Command, _ []string) error {
if addCheckRoot {
return CheckRoot()
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/cloud-init.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func NewCloudInitCmd(root *cobra.Command) *cobra.Command {
Use: "cloud-init",
Short: "Run cloud-init",
Args: cobra.MinimumNArgs(1),
PreRun: func(cmd *cobra.Command, args []string) {
PreRun: func(cmd *cobra.Command, _ []string) {
_ = viper.BindPFlags(cmd.Flags())
},
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
2 changes: 1 addition & 1 deletion cmd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func ReadConfigRun(configDir string, flags *pflag.FlagSet, mounter v1.Mounter) (
cfgExtra := filepath.Join(configDir, "config.d")
if exists, _ := utils.Exists(cfg.Fs, cfgExtra); exists {
viper.AddConfigPath(cfgExtra)
err := filepath.WalkDir(cfgExtra, func(path string, d fs.DirEntry, err error) error {
err := filepath.WalkDir(cfgExtra, func(_ string, d fs.DirEntry, _ error) error {
if !d.IsDir() && filepath.Ext(d.Name()) == ".yaml" {
viper.SetConfigType("yaml")
viper.SetConfigName(strings.TrimSuffix(d.Name(), ".yaml"))
Expand Down
2 changes: 1 addition & 1 deletion cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func NewInstallCmd(root *cobra.Command, addCheckRoot bool) *cobra.Command {
Use: "install DEVICE",
Short: "Elemental installer",
Args: cobra.MaximumNArgs(1),
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(_ *cobra.Command, _ []string) error {
if addCheckRoot {
return CheckRoot()
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func NewMountCmd(root *cobra.Command) *cobra.Command {
c := &cobra.Command{
Use: "mount",
Short: "Mount an elemental system into the specified sysroot",
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
mounter := mount.New(constants.MountBinary)

cfg, err := config.ReadConfigRun(viper.GetString("config-dir"), cmd.Flags(), mounter)
Expand Down
2 changes: 1 addition & 1 deletion cmd/pull-image.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func NewPullImageCmd(root *cobra.Command, addCheckRoot bool) *cobra.Command {
Use: "pull-image IMAGE DESTINATION",
Short: "Pull remote image to local file",
Args: cobra.ExactArgs(2),
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(_ *cobra.Command, _ []string) error {
if addCheckRoot {
return CheckRoot()
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/reset.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ func NewResetCmd(root *cobra.Command, addCheckRoot bool) *cobra.Command {
Use: "reset",
Short: "Reset OS",
Args: cobra.ExactArgs(0),
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(_ *cobra.Command, _ []string) error {
if addCheckRoot {
return CheckRoot()
}
return nil
},
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
path, err := exec.LookPath("mount")
if err != nil {
return err
Expand Down
3 changes: 0 additions & 3 deletions cmd/run-stage.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ func NewRunStage(root *cobra.Command) *cobra.Command {
Use: "run-stage STAGE",
Short: "Run stage from cloud-init",
Args: cobra.MinimumNArgs(1),
PreRun: func(cmd *cobra.Command, args []string) {

},
RunE: func(cmd *cobra.Command, args []string) error {
cfg, err := config.ReadConfigRun(viper.GetString("config-dir"), cmd.Flags(), v1.NewDummyMounter())
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions cmd/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ func NewUpgradeCmd(root *cobra.Command, addCheckRoot bool) *cobra.Command {
Use: "upgrade",
Short: "Upgrade the system",
Args: cobra.ExactArgs(0),
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(_ *cobra.Command, _ []string) error {
if addCheckRoot {
return CheckRoot()
}
return nil
},

RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
path, err := exec.LookPath("mount")
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func NewVersionCmd(root *cobra.Command) *cobra.Command {
Use: "version",
Args: cobra.ExactArgs(0),
Short: "Print the version",
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
v := version.Get()
commit := v.GitCommit
if len(commit) > 7 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/action/build-disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ func (b *BuildDiskAction) CreatePartitionImages() ([]*v1.Image, error) {
return nil, err
}

err = utils.WalkDirFs(b.cfg.Fs, b.roots[constants.EfiPartName], func(path string, d fs.DirEntry, err error) error {
err = utils.WalkDirFs(b.cfg.Fs, b.roots[constants.EfiPartName], func(path string, _ fs.DirEntry, err error) error {
if err != nil {
return err
}
Expand Down
Loading