Skip to content

Commit

Permalink
handling linting issue
Browse files Browse the repository at this point in the history
Signed-off-by: Prateeknandle <prateeknandle@gmail.com>
  • Loading branch information
Prateeknandle committed Feb 10, 2023
1 parent 38345f7 commit e250411
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions discover/discover.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ func ConvertPolicy(c *k8s.Client, o Options) ([]string, error) {

if o.Format == "json" {
arr, _ := json.MarshalIndent(policy, "", " ")
p_str := fmt.Sprintf("%s\n", string(arr))
str = append(str, p_str)
pstr := fmt.Sprintf("%s\n", string(arr))
str = append(str, pstr)
} else if o.Format == "yaml" {
arr, _ := json.Marshal(policy)
yamlarr, _ := yaml.JSONToYAML(arr)
p_str := fmt.Sprintf("%s", string(yamlarr))
str = append(str, p_str)
pstr := fmt.Sprintf("%s", string(yamlarr))
str = append(str, pstr)
} else {
log.Printf("Currently supported formats are json and yaml\n")
break
Expand All @@ -125,13 +125,13 @@ func ConvertPolicy(c *k8s.Client, o Options) ([]string, error) {

if o.Format == "json" {
arr, _ := json.MarshalIndent(policy, "", " ")
p_str := fmt.Sprintf("%s\n", string(arr))
str = append(str, p_str)
pstr := fmt.Sprintf("%s\n", string(arr))
str = append(str, pstr)
} else if o.Format == "yaml" {
arr, _ := json.Marshal(policy)
yamlarr, _ := yaml.JSONToYAML(arr)
p_str := fmt.Sprintf("%s", string(yamlarr))
str = append(str, p_str)
pstr := fmt.Sprintf("%s", string(yamlarr))
str = append(str, pstr)
} else {
fmt.Printf("Currently supported formats are json and yaml\n")
break
Expand All @@ -153,13 +153,13 @@ func ConvertPolicy(c *k8s.Client, o Options) ([]string, error) {

if o.Format == "json" {
arr, _ := json.MarshalIndent(policy, "", " ")
p_str := fmt.Sprintf("%s\n", string(arr))
str = append(str, p_str)
pstr := fmt.Sprintf("%s\n", string(arr))
str = append(str, pstr)
} else if o.Format == "yaml" {
arr, _ := json.Marshal(policy)
yamlarr, _ := yaml.JSONToYAML(arr)
p_str := fmt.Sprintf("%s", string(yamlarr))
str = append(str, p_str)
pstr := fmt.Sprintf("%s", string(yamlarr))
str = append(str, pstr)
} else {
fmt.Printf("Currently supported formats are json and yaml\n")
break
Expand Down

0 comments on commit e250411

Please sign in to comment.