From c3009c3331fd4e3a784d3f917b3d62a366e7893d Mon Sep 17 00:00:00 2001 From: ramaniprateek Date: Fri, 6 Oct 2023 16:20:25 +0530 Subject: [PATCH] Fixed golangci-lint error --- bigip/resource_bigip_ltm_profile_http.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/bigip/resource_bigip_ltm_profile_http.go b/bigip/resource_bigip_ltm_profile_http.go index c506db47b..681330833 100644 --- a/bigip/resource_bigip_ltm_profile_http.go +++ b/bigip/resource_bigip_ltm_profile_http.go @@ -237,9 +237,9 @@ func resourceBigipLtmProfileHttp() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "known_methods": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, Optional: true, Description: "Specifies which HTTP methods count as being known. Removing RFC-defined methods from this list will cause the HTTP filter to not recognize them.", }, @@ -273,13 +273,12 @@ func resourceBigipLtmProfileHttpCreate(ctx context.Context, d *schema.ResourceDa name := d.Get("name").(string) log.Printf("[INFO] Creating HTTP Profile:%+v ", name) - + pss := &bigip.HttpProfile{ Name: name, } config := getHttpProfileConfig(d, pss) - err := client.AddHttpProfile(config) if err != nil { return diag.FromErr(err) @@ -393,7 +392,6 @@ func resourceBigipLtmProfileHttpRead(ctx context.Context, d *schema.ResourceData } _ = d.Set("xff_alternative_names", pp.XffAlternativeNames) - var enforcementList []interface{} enforcement := make(map[string]interface{}) enforcement["max_header_count"] = pp.Enforcement.MaxHeaderCount @@ -490,7 +488,7 @@ func getHttpProfileConfig(d *schema.ResourceData, config *bigip.HttpProfile) *bi config.XffAlternativeNames = setToInterfaceSlice(d.Get("xff_alternative_names").(*schema.Set)) config.LwsWidth = d.Get("lws_width").(int) p := d.Get("http_strict_transport_security") - + for _, r := range p.(*schema.Set).List() { config.Hsts.IncludeSubdomains = r.(map[string]interface{})["include_subdomains"].(string) config.Hsts.Mode = r.(map[string]interface{})["preload"].(string) @@ -498,7 +496,6 @@ func getHttpProfileConfig(d *schema.ResourceData, config *bigip.HttpProfile) *bi config.Hsts.MaximumAge = r.(map[string]interface{})["maximum_age"].(int) } - v := d.Get("enforcement") for _, r := range v.(*schema.Set).List() {