Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Anis Elleuch committed Dec 18, 2023
1 parent f55143f commit 8c4d7a4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cgroup/nolinux.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ package cgroup
import "errors"

// GetMemoryLimit - Not implemented in non-linux platforms
func GetMemoryLimit(pid int) (limit uint64, err error) {
func GetMemoryLimit(_ int) (limit uint64, err error) {
return limit, errors.New("Not implemented for non-linux platforms")
}
10 changes: 5 additions & 5 deletions tier-azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,20 @@ type TierAzure struct {
SPAuth ServicePrincipalAuth `json:",omitempty"`
}

func (t TierAzure) Validate() error {
if t.AccountName == "" && t.AccountKey != "" || t.AccountName != "" && t.AccountKey == "" {
func (ti TierAzure) Validate() error {
if ti.AccountName == "" && ti.AccountKey != "" || ti.AccountName != "" && ti.AccountKey == "" {
return errors.New("both account name and key need to be provided")
}

if t.AccountName != "" {
if ti.AccountName != "" {
return nil
}

if t.SPAuth.TenantID == "" && t.SPAuth.ClientID == "" && t.SPAuth.ClientSecret == "" {
if ti.SPAuth.TenantID == "" && ti.SPAuth.ClientID == "" && ti.SPAuth.ClientSecret == "" {
return errors.New("either static credentials or service principal credentials are required")
}

if t.SPAuth.TenantID == "" || t.SPAuth.ClientID == "" || t.SPAuth.ClientSecret == "" {
if ti.SPAuth.TenantID == "" || ti.SPAuth.ClientID == "" || ti.SPAuth.ClientSecret == "" {
return errors.New("the tenant and the client ID and the secret are required")
}

Expand Down
6 changes: 3 additions & 3 deletions tier-gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ type TierGCS struct {
StorageClass string `json:",omitempty"`
}

func (t TierGCS) Validate() error {
if t.Creds == "" {
func (gcs TierGCS) Validate() error {
if gcs.Creds == "" {
return errors.New("the credentials file cannot be empty")
}
if t.Bucket == "" {
if gcs.Bucket == "" {
return errors.New("the bucket name is required")
}
return nil
Expand Down

0 comments on commit 8c4d7a4

Please sign in to comment.