Skip to content

Commit

Permalink
Fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
willguibr committed Oct 24, 2022
1 parent e738e98 commit a63894b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
2 changes: 2 additions & 0 deletions zpa/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ func flattenNetworkPorts(ports []common.NetworkPorts) []interface{} {
return portsObj
}

/*
func expandNetwokPorts(d *schema.ResourceData, key string) []common.NetworkPorts {
var ports []common.NetworkPorts
if portsInterface, ok := d.GetOk(key); ok {
Expand All @@ -611,6 +612,7 @@ func expandNetwokPorts(d *schema.ResourceData, key string) []common.NetworkPorts
}
return ports
}
*/

func resourceAppSegmentPortRange(desc string) *schema.Schema {
return &schema.Schema{
Expand Down
29 changes: 15 additions & 14 deletions zpa/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,23 +101,24 @@ func convertToPortRange(portRangeLst []interface{}) []string {
return portRanges
}

func convertToListString(obj interface{}) []string {
listI, ok := obj.([]interface{})
if ok && len(listI) > 0 {
list := make([]string, len(listI))
for i, e := range listI {
s, ok := e.(string)
if ok {
list[i] = e.(string)
} else {
log.Printf("[WARN] invalid type: %v\n", s)
/*
func convertToListString(obj interface{}) []string {
listI, ok := obj.([]interface{})
if ok && len(listI) > 0 {
list := make([]string, len(listI))
for i, e := range listI {
s, ok := e.(string)
if ok {
list[i] = e.(string)
} else {
log.Printf("[WARN] invalid type: %v\n", s)
}
}
return list
}
return list
return []string{}
}
return []string{}
}

*/
func expandList(portRangeLst []interface{}) []string {
portRanges := make([]string, len(portRangeLst))
for i, port := range portRangeLst {
Expand Down

0 comments on commit a63894b

Please sign in to comment.