Skip to content

Commit

Permalink
chore: fix linter issues
Browse files Browse the repository at this point in the history
Related issue: harvester/harvester#7336

Signed-off-by: Tim Serong <[email protected]>
  • Loading branch information
tserong authored and bk201 committed Jan 10, 2025
1 parent ac36f1f commit c78f37a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ const (
)

const (
SingleDiskMinSizeGiB = 250
MultipleDiskMinSizeGiB = 180
HardMinDataDiskSizeGiB = 50
MaxPods = 200
SingleDiskMinSizeGiB uint64 = 250
MultipleDiskMinSizeGiB uint64 = 180
HardMinDataDiskSizeGiB uint64 = 50
MaxPods = 200
)

// refer: https://github.com/harvester/harvester/blob/master/pkg/settings/settings.go
Expand Down
4 changes: 2 additions & 2 deletions pkg/console/spinner.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (s *Spinner) Stop(err bool, message string) {
<-s.stopped
}

func (s *Spinner) writePanel(message string, clear bool, fgColor gocui.Attribute) {
func (s *Spinner) writePanel(message string, clearView bool, fgColor gocui.Attribute) {
// g.Update spawns a goroutine to notify gocui to update.
// wait until cui consumes the notification to make sure any remaining
// writePanel calls don't go first
Expand All @@ -100,7 +100,7 @@ func (s *Spinner) writePanel(message string, clear bool, fgColor gocui.Attribute
if s.focus {
g.SetCurrentView(s.panel)
}
if clear {
if clearView {
v.Clear()
}
v.FgColor = fgColor
Expand Down
6 changes: 3 additions & 3 deletions pkg/console/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ func saveElementalConfig(obj interface{}) (string, string, error) {
}

elementalConfigFile := filepath.Join(ElementalConfigDir, ElementalConfigFile)
err = ioutil.WriteFile(elementalConfigFile, bytes, os.ModePerm)
err = ioutil.WriteFile(elementalConfigFile, bytes, 0600)
if err != nil {
return "", "", err
}
Expand Down Expand Up @@ -703,7 +703,7 @@ func validateDiskSize(devPath string, single bool) error {
if !single {
limit = config.MultipleDiskMinSizeGiB
}
if util.ByteToGi(diskSizeBytes) < uint64(limit) {
if util.ByteToGi(diskSizeBytes) < limit {
return fmt.Errorf("Installation disk size is too small. Minimum %dGi is required", limit)
}

Expand Down Expand Up @@ -1047,7 +1047,7 @@ const (
// identifyUniqueDisks parses the json output of lsblk and identifies
// unique disks by comparing their serial number info and wwn details
func identifyUniqueDisks(output []byte) ([]string, error) {
var returnDisks []string
returnDisks := []string{}
disks := &BlockDevices{}
err := json.Unmarshal(output, disks)
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions pkg/util/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ func DupStrings(src []string) []string {
return s
}

func ByteToGi(byte uint64) uint64 {
return byte >> 30
func ByteToGi(b uint64) uint64 {
return b >> 30
}

func ByteToMi(byte uint64) uint64 {
return byte >> 20
func ByteToMi(b uint64) uint64 {
return b >> 20
}

func GiToByte(gi uint64) uint64 {
Expand Down

0 comments on commit c78f37a

Please sign in to comment.