From 088d0158d381bf7dae777b4479270f81b383062c Mon Sep 17 00:00:00 2001 From: kt Date: Wed, 7 Dec 2022 16:27:14 -0800 Subject: [PATCH] fix linting --- .golangci.yml | 2 +- contributing/topics/guide-new-data-source.md | 2 +- contributing/topics/guide-new-resource.md | 4 +- internal/acceptance/testing.go | 4 +- internal/clients/client.go | 5 +- internal/clients/client_gen.go | 3 +- internal/sdk/README.md | 2 +- internal/sdk/logger_console.go | 4 +- internal/sdk/plugin_sdk_test.go | 30 ++-- .../advisor_recommendations_data_source.go | 2 +- internal/services/advisor/client/client.go | 2 +- .../analysis_services_server_resource_test.go | 2 +- .../api_management_api_data_source.go | 2 +- .../api_management_api_diagnostic_resource.go | 4 +- ...anagement_api_operation_policy_resource.go | 2 +- ...ment_api_operation_policy_resource_test.go | 2 +- .../api_management_api_operation_resource.go | 2 +- ...i_management_api_operation_tag_resource.go | 2 +- .../api_management_api_policy_resource.go | 2 +- ...api_management_api_policy_resource_test.go | 2 +- .../api_management_api_release.go | 2 +- .../api_management_api_resource.go | 2 +- .../api_management_api_schema_resource.go | 2 +- ...api_management_api_schema_resource_test.go | 14 -- ...management_api_tag_description_resource.go | 2 +- ...api_management_api_version_set_resource.go | 2 +- ...anagement_authorization_server_resource.go | 2 +- .../api_management_backend_resource.go | 2 +- .../api_management_certificate_resource.go | 2 +- .../api_management_custom_domain_resource.go | 4 +- .../api_management_data_source.go | 2 +- .../api_management_diagnostic_resource.go | 2 +- .../api_management_email_template_resource.go | 2 +- ...management_email_template_resource_test.go | 2 +- .../api_management_gateway_api_resource.go | 2 +- ..._gateway_certificate_authority_resource.go | 2 +- ...ateway_host_name_configuration_resource.go | 2 +- .../api_management_gateway_resource.go | 2 +- .../api_management_group_resource.go | 2 +- ...nagement_identity_provider_aad_resource.go | 2 +- ...ent_identity_provider_aad_resource_test.go | 2 +- ...ement_identity_provider_aadb2c_resource.go | 2 +- ..._identity_provider_aadb2c_resource_test.go | 4 +- ...ent_identity_provider_facebook_resource.go | 2 +- ...dentity_provider_facebook_resource_test.go | 2 +- ...ement_identity_provider_google_resource.go | 2 +- ..._identity_provider_google_resource_test.go | 2 +- ...nt_identity_provider_microsoft_resource.go | 2 +- ...entity_provider_microsoft_resource_test.go | 2 +- ...ment_identity_provider_twitter_resource.go | 2 +- ...identity_provider_twitter_resource_test.go | 2 +- .../api_management_logger_resource.go | 2 +- .../api_management_named_value_resource.go | 2 +- ...management_notification_recipient_email.go | 2 +- ...ement_notification_recipient_email_test.go | 2 +- ..._management_notification_recipient_user.go | 2 +- ...gement_notification_recipient_user_test.go | 2 +- ...gement_openid_connect_provider_resource.go | 2 +- .../api_management_policy_resource.go | 2 +- .../api_management_product_data_source.go | 2 +- .../api_management_product_policy_resource.go | 2 +- ...management_product_policy_resource_test.go | 2 +- .../api_management_product_resource.go | 2 +- .../api_management_redis_cache_resource.go | 2 +- .../apimanagement/api_management_resource.go | 10 +- .../api_management_subscription_resource.go | 2 +- .../api_management_tag_resource.go | 2 +- .../api_management_user_resource.go | 2 +- .../services/apimanagement/client/client.go | 2 +- .../apimanagement/identity_provider_import.go | 2 +- .../apimanagement/migration/policy.go | 2 +- .../apimanagement/schemaz/api_management.go | 2 +- ...app_configuration_keys_data_source_test.go | 4 +- .../app_configuration_resource.go | 18 +- ...cation_insights_analytics_item_resource.go | 2 +- .../application_insights_api_key_resource.go | 2 +- .../application_insights_resource.go | 4 +- ..._insights_smart_detection_rule_resource.go | 2 +- .../application_insights_webtests_resource.go | 2 +- .../application_insights_workbook_resource.go | 5 +- ...ion_insights_workbook_template_resource.go | 29 +--- .../azuresdkhacks/webtests.go | 2 +- .../applicationinsights/client/client.go | 2 +- internal/services/appservice/client/client.go | 2 +- .../function_app_active_slot_resource.go | 2 +- .../function_app_function_resource.go | 2 +- ...function_app_hybrid_connection_resource.go | 2 +- .../appservice/helpers/function_app_schema.go | 2 +- .../helpers/function_app_schema_test.go | 2 +- .../helpers/function_app_slot_schema.go | 2 +- .../appservice/helpers/publish_app.go | 2 +- .../appservice/helpers/shared_schema.go | 2 +- .../appservice/helpers/web_app_schema.go | 10 +- .../appservice/helpers/web_app_slot_schema.go | 2 +- internal/services/appservice/identity.go | 2 +- .../linux_function_app_data_source.go | 2 +- .../appservice/linux_function_app_resource.go | 2 +- .../linux_function_app_slot_resource.go | 2 +- .../linux_function_app_slot_resource_test.go | 1 + .../appservice/linux_web_app_resource.go | 4 +- .../appservice/linux_web_app_slot_resource.go | 4 +- .../appservice/service_plan_resource.go | 2 +- .../appservice/source_control_resource.go | 2 +- .../appservice/source_control_schema.go | 2 +- .../source_control_slot_resource.go | 2 +- .../source_control_token_resource.go | 2 +- .../web_app_active_slot_resource.go | 2 +- .../web_app_hybrid_connection_resource.go | 2 +- .../windows_function_app_data_source.go | 2 +- .../windows_function_app_resource.go | 2 +- .../windows_function_app_slot_resource.go | 2 +- .../appservice/windows_web_app_resource.go | 4 +- .../windows_web_app_resource_test.go | 1 + .../windows_web_app_slot_resource.go | 4 +- .../azuresdkhacks/definitions.go | 2 +- .../services/authorization/client/client.go | 2 +- .../authorization/role_assignment_resource.go | 4 +- .../role_assignment_resource_test.go | 1 + .../role_definition_data_source.go | 2 +- .../authorization/role_definition_resource.go | 4 +- .../automation/automation_account_resource.go | 6 +- .../automation_certificate_resource.go | 2 +- ...omation_connection_certificate_resource.go | 2 +- ...connection_classic_certificate_resource.go | 2 +- .../automation_connection_resource.go | 2 +- ...n_connection_service_principal_resource.go | 2 +- .../automation_connection_type_resource.go | 2 +- .../automation_credential_resource.go | 2 +- .../automation_dsc_configuration_resource.go | 2 +- ...tomation_dsc_nodeconfiguration_resource.go | 2 +- .../automation_job_schedule_resource.go | 2 +- .../automation/automation_module_resource.go | 6 +- .../automation/automation_runbook_resource.go | 2 +- .../automation_schedule_resource.go | 2 +- ...utomation_software_update_configuration.go | 6 +- .../automation/automation_source_control.go | 2 +- .../automation/automation_variable.go | 2 +- .../automation/automation_variable_test.go | 4 +- .../services/automation/automation_watcher.go | 2 +- .../services/automation/automation_webhook.go | 2 +- internal/services/automation/client/client.go | 2 +- .../helper/automation_job_schedule.go | 2 +- internal/services/batch/batch_account.go | 2 +- .../batch/batch_account_data_source.go | 2 +- .../services/batch/batch_account_resource.go | 2 +- .../batch/batch_application_resource.go | 2 +- .../batch/batch_certificate_resource.go | 2 +- internal/services/batch/batch_pool.go | 54 +++--- .../services/batch/batch_pool_resource.go | 4 +- internal/services/batch/client/client.go | 2 +- internal/services/blueprints/blueprint.go | 2 +- .../blueprint_assignment_resource.go | 2 +- internal/services/blueprints/client/client.go | 2 +- .../bot/bot_channel_alexa_resource.go | 2 +- .../bot/bot_channel_alexa_resource_test.go | 2 +- ...bot_channel_direct_line_speech_resource.go | 2 +- ...hannel_direct_line_speech_resource_test.go | 2 +- .../bot/bot_channel_directline_resource.go | 2 +- .../bot_channel_directline_resource_test.go | 2 +- .../bot/bot_channel_email_resource.go | 2 +- .../bot/bot_channel_email_resource_test.go | 2 +- .../bot/bot_channel_facebook_resource.go | 2 +- .../bot/bot_channel_facebook_resource_test.go | 2 +- .../services/bot/bot_channel_line_resource.go | 2 +- .../bot/bot_channel_line_resource_test.go | 2 +- .../bot/bot_channel_ms_teams_resource.go | 2 +- .../bot/bot_channel_ms_teams_resource_test.go | 2 +- .../bot/bot_channel_slack_resource.go | 2 +- .../bot/bot_channel_slack_resource_test.go | 2 +- .../services/bot/bot_channel_sms_resource.go | 2 +- .../bot/bot_channel_sms_resource_test.go | 2 +- .../bot/bot_channel_web_chat_resource.go | 2 +- .../bot/bot_channel_web_chat_resource_test.go | 2 +- .../bot/bot_channels_registration_resource.go | 2 +- .../services/bot/bot_connection_resource.go | 2 +- .../services/bot/bot_healthbot_resource.go | 2 +- .../bot/bot_service_azure_bot_resource.go | 2 +- .../services/bot/bot_service_base_resource.go | 2 +- internal/services/bot/bot_web_app_resource.go | 2 +- internal/services/bot/client/client.go | 4 +- .../cdn/azuresdkhacks/cdn_frontdoor_route.go | 2 +- .../cdn_endpoint_custom_domain_resource.go | 6 +- .../services/cdn/cdn_endpoint_resource.go | 2 +- .../cdn_frontdoor_custom_domain_resource.go | 6 +- .../cdn/cdn_frontdoor_endpoint_resource.go | 2 +- ...n_frontdoor_firewall_policy_data_source.go | 2 +- .../cdn_frontdoor_firewall_policy_resource.go | 2 +- .../services/cdn/cdn_frontdoor_helpers.go | 6 +- .../cdn_frontdoor_origin_group_resource.go | 2 +- .../cdn/cdn_frontdoor_origin_resource.go | 2 +- .../cdn/cdn_frontdoor_origin_resource_test.go | 8 + .../cdn/cdn_frontdoor_profile_resource.go | 2 +- ...disable_link_to_default_domain_resource.go | 2 +- .../cdn/cdn_frontdoor_route_resource.go | 6 +- .../cdn/cdn_frontdoor_rule_resource.go | 2 +- .../cdn_frontdoor_secret_data_source_test.go | 55 ------ .../cdn/cdn_frontdoor_secret_resource.go | 2 +- .../cdn_frontdoor_security_policy_resource.go | 2 +- .../cdn/cdn_frontdoor_shared_schema.go | 2 +- internal/services/cdn/cdn_profile_resource.go | 2 +- internal/services/cdn/client/client.go | 6 +- .../deliveryruleactions/cache_expiration.go | 2 +- .../cache_key_query_string.go | 2 +- .../modify_request_header.go | 2 +- .../modify_response_header.go | 2 +- .../cdn/deliveryruleactions/url_redirect.go | 2 +- .../cdn/deliveryruleactions/url_rewrite.go | 2 +- .../cdn/deliveryruleconditions/cookies.go | 2 +- .../cdn/deliveryruleconditions/device.go | 2 +- .../deliveryruleconditions/http_version.go | 2 +- .../cdn/deliveryruleconditions/post_arg.go | 2 +- .../deliveryruleconditions/query_string.go | 2 +- .../deliveryruleconditions/remote_address.go | 2 +- .../deliveryruleconditions/request_body.go | 2 +- .../deliveryruleconditions/request_header.go | 2 +- .../deliveryruleconditions/request_method.go | 2 +- .../deliveryruleconditions/request_scheme.go | 2 +- .../cdn/deliveryruleconditions/request_uri.go | 2 +- .../url_file_extension.go | 2 +- .../deliveryruleconditions/url_file_name.go | 2 +- .../cdn/deliveryruleconditions/url_path.go | 2 +- .../services/cdn/endpoint_delivery_rule.go | 2 +- .../cdn/endpoint_global_delivery_rule.go | 4 +- .../cdn_frontdoor_rule_actions.go | 2 +- .../cdn_frontdoor_rule_conditions.go | 2 +- .../cdn_frontdoor_secret_params.go | 2 +- .../cdn_frontdoor_security_params.go | 2 +- .../front_door_route_https_redirect.go | 2 +- .../validate/front_door_validation_helpers.go | 2 +- .../cognitive/cognitive_account_resource.go | 8 +- internal/services/compute/client/client.go | 2 +- .../compute/disk_sas_token_resource.go | 2 +- .../compute/linux_virtual_machine_resource.go | 5 +- ...nux_virtual_machine_resource_other_test.go | 1 + ...machine_scale_set_disk_os_resource_test.go | 46 ----- ...machine_scale_set_network_resource_test.go | 2 + ...inux_virtual_machine_scale_set_resource.go | 10 +- .../services/compute/managed_disk_resource.go | 5 +- .../compute/managed_disk_resource_test.go | 18 -- .../services/compute/no_downtime_resize.go | 12 +- ...ated_virtual_machine_scale_set_resource.go | 10 +- .../services/compute/shared_image_resource.go | 4 +- internal/services/compute/shared_schema.go | 12 +- .../compute/virtual_machine_scale_set.go | 2 +- .../windows_virtual_machine_resource.go | 5 +- ...ows_virtual_machine_resource_other_test.go | 1 + ...machine_scale_set_network_resource_test.go | 1 + ...dows_virtual_machine_scale_set_resource.go | 10 +- internal/services/containers/client/client.go | 4 +- .../container_connected_registry_resource.go | 2 +- .../container_registry_agent_pool_resource.go | 2 +- .../containers/container_registry_resource.go | 4 +- .../container_registry_scope_map_resource.go | 2 +- .../container_registry_task_resource.go | 2 +- ...registry_task_schedule_run_now_resource.go | 2 +- .../container_registry_token_data_source.go | 2 +- ...tainer_registry_token_password_resource.go | 2 +- .../container_registry_token_resource.go | 2 +- .../container_registry_webhook_resource.go | 2 +- .../kubernetes_cluster_data_source.go | 2 +- .../containers/kubernetes_cluster_resource.go | 10 +- internal/services/cosmos/client/client.go | 2 +- .../cosmos/common/autoscale_settings.go | 2 +- .../common/conflict_resolution_policy.go | 2 +- internal/services/cosmos/common/cors_rule.go | 2 +- .../services/cosmos/common/indexing_policy.go | 2 +- .../cosmos/common/indexing_policy_test.go | 2 +- internal/services/cosmos/common/ip_rules.go | 2 +- .../services/cosmos/common/ip_rules_test.go | 2 +- internal/services/cosmos/common/schema.go | 4 +- internal/services/cosmos/common/throughput.go | 2 +- .../cosmos/cosmosdb_account_data_source.go | 2 +- .../cosmosdb_account_data_source_test.go | 2 +- .../cosmos/cosmosdb_account_resource.go | 2 +- .../cosmos/cosmosdb_account_resource_test.go | 3 +- .../cosmosdb_cassandra_datacenter_resource.go | 2 +- .../cosmosdb_cassandra_keyspace_resource.go | 2 +- ...smosdb_cassandra_keyspace_resource_test.go | 2 +- .../cosmosdb_cassandra_table_resource.go | 2 +- .../cosmosdb_gremlin_database_resource.go | 2 +- ...cosmosdb_gremlin_database_resource_test.go | 2 +- .../cosmos/cosmosdb_gremlin_graph_resource.go | 2 +- .../cosmosdb_mongo_collection_resource.go | 2 +- ...cosmosdb_mongo_collection_resource_test.go | 2 +- .../cosmosdb_mongo_database_resource.go | 2 +- .../cosmosdb_mongo_database_resource_test.go | 2 +- .../cosmosdb_notebook_workspace_resource.go | 2 +- ...smosdb_notebook_workspace_resource_test.go | 3 + ...estorable_database_accounts_data_source.go | 2 +- .../cosmos/cosmosdb_sql_container_resource.go | 2 +- .../cosmosdb_sql_container_resource_test.go | 2 +- .../cosmos/cosmosdb_sql_database_resource.go | 2 +- .../cosmosdb_sql_database_resource_test.go | 2 +- .../cosmos/cosmosdb_sql_function_resource.go | 2 +- .../cosmosdb_sql_function_resource_test.go | 2 +- .../cosmosdb_sql_role_assignment_resource.go | 2 +- .../cosmosdb_sql_role_definition_resource.go | 2 +- .../cosmosdb_sql_stored_procedure_resource.go | 2 +- ...osdb_sql_stored_procedure_resource_test.go | 2 +- .../cosmos/cosmosdb_sql_trigger_resource.go | 2 +- .../cosmosdb_sql_trigger_resource_test.go | 2 +- .../cosmos/cosmosdb_table_resource.go | 2 +- .../cosmos/cosmosdb_table_resource_test.go | 2 +- .../custom_provider_resource.go | 2 +- .../dashboard/dashboard_grafana_resource.go | 22 +-- .../databasemigration/client/client.go | 2 +- .../database_migration_project_resource.go | 2 +- .../database_migration_service_resource.go | 2 +- .../services/databoxedge/client/client.go | 2 +- .../databox_edge_device_resource.go | 2 +- .../databox_edge_order_resource.go | 2 +- .../parse/databox_edge_device_sku.go | 2 +- .../validate/databox_edge_device_sku_name.go | 2 +- .../validate/access_connector_name_test.go | 1 - ...urerm_datadog_monitor_sso_configuration.go | 2 +- internal/services/datadog/client/client.go | 2 +- .../datadog_monitor_tag_rule_resource.go | 2 +- .../datadog_monitor_tag_rule_resource_test.go | 2 +- .../datadog/datadog_monitors_resource.go | 2 +- .../services/datafactory/client/client.go | 2 +- internal/services/datafactory/data_factory.go | 2 +- .../data_factory_custom_dataset_resource.go | 2 +- .../datafactory/data_factory_data_flow.go | 2 +- .../data_factory_data_flow_resource.go | 2 +- .../datafactory/data_factory_data_source.go | 2 +- ...ata_factory_dataset_azure_blob_resource.go | 2 +- .../data_factory_dataset_binary_resource.go | 2 +- ...actory_dataset_cosmosdb_sqlapi_resource.go | 2 +- ...factory_dataset_delimited_text_resource.go | 2 +- .../data_factory_dataset_http_resource.go | 2 +- .../data_factory_dataset_json_resource.go | 2 +- .../data_factory_dataset_mysql_resource.go | 2 +- .../data_factory_dataset_parquet_resource.go | 2 +- ...ata_factory_dataset_postgresql_resource.go | 2 +- ...data_factory_dataset_snowflake_resource.go | 2 +- ...ctory_dataset_sql_server_table_resource.go | 2 +- ...data_factory_flowlet_data_flow_resource.go | 2 +- ...tory_integration_runtime_azure_resource.go | 2 +- ...integration_runtime_azure_ssis_resource.go | 2 +- ...ry_integration_runtime_managed_resource.go | 2 +- ...ntegration_runtime_self_hosted_resource.go | 2 +- ..._factory_linked_custom_service_resource.go | 2 +- .../data_factory_linked_service.go | 2 +- ...ked_service_azure_blob_storage_resource.go | 2 +- ...inked_service_azure_databricks_resource.go | 2 +- ...ked_service_azure_file_storage_resource.go | 2 +- ..._linked_service_azure_function_resource.go | 2 +- ...ry_linked_service_azure_search_resource.go | 2 +- ...ked_service_azure_sql_database_resource.go | 2 +- ...ed_service_azure_table_storage_resource.go | 2 +- ...nked_service_cosmosdb_mongoapi_resource.go | 2 +- ...actory_linked_service_cosmosdb_resource.go | 2 +- ...service_data_lake_storage_gen2_resource.go | 2 +- ...ctory_linked_service_key_vault_resource.go | 2 +- ...a_factory_linked_service_kusto_resource.go | 2 +- ...a_factory_linked_service_mysql_resource.go | 2 +- ...a_factory_linked_service_odata_resource.go | 2 +- ...ta_factory_linked_service_odbc_resource.go | 2 +- ...tory_linked_service_postgresql_resource.go | 2 +- ...ta_factory_linked_service_sftp_resource.go | 2 +- ...ctory_linked_service_snowflake_resource.go | 2 +- ...tory_linked_service_sql_server_resource.go | 2 +- ...factory_linked_service_synapse_resource.go | 2 +- ...ata_factory_linked_service_web_resource.go | 2 +- ...ctory_managed_private_endpoint_resource.go | 2 +- .../data_factory_pipeline_resource.go | 2 +- .../datafactory/data_factory_resource.go | 2 +- ...ata_factory_trigger_blob_event_resource.go | 2 +- ...a_factory_trigger_custom_event_resource.go | 2 +- .../data_factory_trigger_schedule_resource.go | 2 +- ...actory_trigger_tumbling_window_resource.go | 2 +- .../datafactory/migration/data_factory.go | 2 +- ...ction_backup_policy_postgresql_resource.go | 4 +- internal/services/datashare/client/client.go | 2 +- .../datashare/data_share_account_resource.go | 2 +- .../datashare/data_share_data_source.go | 2 +- ..._share_dataset_blob_storage_data_source.go | 2 +- ...ata_share_dataset_blob_storage_resource.go | 2 +- ...hare_dataset_blob_storage_resource_test.go | 2 +- ...hare_dataset_data_lake_gen2_data_source.go | 2 +- ...a_share_dataset_data_lake_gen2_resource.go | 2 +- ...re_dataset_data_lake_gen2_resource_test.go | 2 +- ...ta_share_dataset_kusto_cluster_resource.go | 2 +- ...a_share_dataset_kusto_database_resource.go | 2 +- .../services/datashare/data_share_resource.go | 2 +- .../services/datashare/helper/data_share.go | 2 +- .../services/devtestlabs/client/client.go | 2 +- ...st_global_vm_shutdown_schedule_resource.go | 2 +- .../devtestlabs/dev_test_lab_resource.go | 2 +- .../dev_test_lab_schedule_resource.go | 2 +- ...dev_test_linux_virtual_machine_resource.go | 2 +- .../devtestlabs/dev_test_policy_resource.go | 2 +- .../dev_test_virtual_network_data_source.go | 2 +- .../dev_test_virtual_network_resource.go | 2 +- ...v_test_windows_virtual_machine_resource.go | 2 +- internal/services/devtestlabs/helpers.go | 2 +- .../services/devtestlabs/validate/devtest.go | 2 +- .../services/digitaltwins/client/client.go | 2 +- ...gital_twins_endpoint_eventgrid_resource.go | 2 +- ...igital_twins_endpoint_eventhub_resource.go | 2 +- ...ital_twins_endpoint_servicebus_resource.go | 2 +- .../digital_twins_instance_resource.go | 2 +- ...tory_domain_service_trust_resource_test.go | 2 +- internal/services/eventgrid/client/client.go | 2 +- .../services/eventgrid/event_subscription.go | 2 +- internal/services/eventgrid/eventgrid.go | 2 +- .../eventgrid/eventgrid_domain_resource.go | 6 +- .../eventgrid_event_subscription_resource.go | 2 +- ...ystem_topic_event_subscription_resource.go | 2 +- .../eventgrid_system_topic_resource.go | 2 +- .../eventgrid/eventgrid_topic_resource.go | 6 +- .../fluid_relay_servers_resource.go | 28 +-- .../frontdoor/frontdoor_resource_test.go | 68 -------- internal/services/hdinsight/client/client.go | 2 +- .../services/hdinsight/common_hdinsight.go | 2 +- .../hdinsight_hadoop_cluster_resource.go | 2 +- .../hdinsight_hbase_cluster_resource.go | 2 +- ...ight_interactive_query_cluster_resource.go | 2 +- .../hdinsight_kafka_cluster_resource.go | 2 +- .../hdinsight_spark_cluster_resource.go | 2 +- internal/services/hdinsight/schema.go | 2 +- internal/services/healthcare/client/client.go | 2 +- .../healthcare/healthcare_dicom_resource.go | 2 +- .../healthcare/healthcare_fhir_resource.go | 2 +- ...dtech_service_fhir_destination_resource.go | 2 +- .../healthcare_medtech_service_resource.go | 2 +- .../healthcare/healthcare_service_resource.go | 2 +- .../healthcare_workspace_resource.go | 2 +- internal/services/hpccache/client/client.go | 2 +- internal/services/hpccache/hpc_cache.go | 2 +- .../hpc_cache_access_policy_resource.go | 2 +- .../hpc_cache_blob_nfs_target_resource.go | 2 +- .../hpc_cache_blob_target_resource.go | 2 +- .../hpccache/hpc_cache_nfs_target_resource.go | 2 +- .../services/hpccache/hpc_cache_resource.go | 2 +- ...lication_network_rule_set_resource_test.go | 2 +- .../iotcentral_application_resource.go | 2 +- .../iothub_device_update_instance_resource.go | 12 +- ...ub_dps_shared_access_policy_data_source.go | 3 +- ...othub_dps_shared_access_policy_resource.go | 2 +- .../iottimeseriesinsights/client/client.go | 2 +- ..._series_insights_access_policy_resource.go | 2 +- ...e_series_insights_event_source_eventhub.go | 2 +- ...ime_series_insights_event_source_iothub.go | 2 +- ...ries_insights_gen2_environment_resource.go | 2 +- ...es_insights_reference_data_set_resource.go | 2 +- ..._insights_standard_environment_resource.go | 2 +- .../services/keyvault/access_policy_schema.go | 2 +- internal/services/keyvault/client/client.go | 2 +- .../key_vault_access_policy_data_source.go | 2 +- .../key_vault_access_policy_resource.go | 2 +- .../keyvault/key_vault_data_source.go | 2 +- ...naged_hardware_security_module_resource.go | 2 +- .../services/keyvault/key_vault_resource.go | 2 +- internal/services/kusto/client/client.go | 2 +- internal/services/kusto/identity.go | 2 +- ...ttached_database_configuration_resource.go | 2 +- ...o_cluster_customer_managed_key_resource.go | 2 +- ...uster_managed_private_endpoint_resource.go | 2 +- ...o_cluster_principal_assignment_resource.go | 2 +- .../services/kusto/kusto_cluster_resource.go | 4 +- .../kusto/kusto_data_connection_import.go | 2 +- ..._database_principal_assignment_resource.go | 2 +- .../services/kusto/kusto_database_resource.go | 2 +- .../kusto/kusto_database_script_resource.go | 2 +- ...usto_eventgrid_data_connection_resource.go | 2 +- ...kusto_eventhub_data_connection_resource.go | 2 +- .../kusto_iothub_data_connection_resource.go | 2 +- .../loadbalancer/loadbalancer_resource.go | 10 +- .../log_analytics_workspace_resource.go | 1 + internal/services/logic/client/client.go | 2 +- .../logic/integration_service_environment.go | 2 +- .../logic/logic_app_action_http_resource.go | 2 +- ..._integration_account_agreement_resource.go | 2 +- ...p_integration_account_assembly_resource.go | 2 +- ...on_account_batch_configuration_resource.go | 2 +- ...ntegration_account_certificate_resource.go | 2 +- ...ic_app_integration_account_map_resource.go | 2 +- ...pp_integration_account_partner_resource.go | 2 +- .../logic_app_integration_account_resource.go | 2 +- ...app_integration_account_schema_resource.go | 2 +- ...pp_integration_account_session_resource.go | 2 +- .../logic/logic_app_standard_data_source.go | 2 +- .../logic/logic_app_standard_resource.go | 2 +- .../logic/logic_app_workflow_data_source.go | 2 +- .../logic/logic_app_workflow_resource.go | 2 +- internal/services/logic/logic_apps.go | 2 +- internal/services/logz/client/client.go | 2 +- internal/services/logz/logz_common.go | 2 +- .../services/logz/logz_monitor_resource.go | 2 +- .../logz/logz_sub_account_resource.go | 2 +- .../logz_sub_account_tag_rule_resource.go | 2 +- .../services/logz/logz_tag_rule_resource.go | 2 +- .../machine_learning_workspace_resource.go | 1 + ...tenance_configurations_data_source_test.go | 13 +- .../managedapplications/client/client.go | 2 +- ...managed_application_definition_resource.go | 2 +- .../managed_application_resource.go | 2 +- .../federated_identity_credential_resource.go | 46 ++--- .../services/managementgroup/client/client.go | 2 +- .../management_group_data_source.go | 2 +- .../management_group_resource.go | 2 +- .../subscription_association_resource.go | 2 +- .../subscription_association_resource_test.go | 2 +- internal/services/media/client/client.go | 2 +- .../media/media_asset_filter_resource.go | 4 +- .../services/media/media_asset_resource.go | 2 +- .../media_content_key_policy_resource.go | 14 +- internal/services/media/media_job_resource.go | 2 +- .../media/media_live_output_resource.go | 2 +- .../media/media_services_account_resource.go | 2 +- .../media_streaming_endpoint_resource.go | 6 +- .../media_streaming_live_event_resource.go | 6 +- .../media/media_streaming_locator_resource.go | 4 +- .../media/media_streaming_policy_resource.go | 6 +- .../media/media_transform_resource.go | 12 +- internal/services/monitor/action_rule.go | 2 +- .../services/monitor/alert_processing_rule.go | 1 - internal/services/monitor/client/client.go | 10 +- internal/services/monitor/common_monitor.go | 2 +- ...monitor_aad_diagnostic_setting_resource.go | 2 +- .../monitor/monitor_action_group_resource.go | 2 +- ...nitor_action_rule_action_group_resource.go | 2 +- ...onitor_action_rule_suppression_resource.go | 2 +- .../monitor_activity_log_alert_resource.go | 6 +- .../monitor_autoscale_setting_resource.go | 2 +- ...nitor_diagnostic_categories_data_source.go | 4 +- .../monitor/monitor_log_profile_resource.go | 2 +- .../monitor/monitor_metric_alert_resource.go | 6 +- .../monitor_private_link_scope_resource.go | 2 +- ...or_private_link_scoped_service_resource.go | 2 +- ...scheduled_query_rules_alert_data_source.go | 2 +- ...or_scheduled_query_rules_alert_resource.go | 2 +- ...scheduled_query_rules_alert_v2_resource.go | 118 ++++--------- ...r_scheduled_query_rules_log_data_source.go | 2 +- ...itor_scheduled_query_rules_log_resource.go | 2 +- ...itor_smart_detector_alert_rule_resource.go | 2 +- internal/services/mssql/client/client.go | 2 +- internal/services/mssql/helper/database.go | 4 +- .../mssql/helper/sql_extended_auditing.go | 2 +- .../mssql/helper/sql_retention_policies.go | 2 +- .../mssql/mssql_database_data_source.go | 2 +- ...abase_extended_auditing_policy_resource.go | 2 +- .../services/mssql/mssql_database_resource.go | 2 +- ...ility_assessment_rule_baseline_resource.go | 2 +- ..._assessment_rule_baseline_resource_test.go | 2 +- .../mssql/mssql_elasticpool_resource.go | 2 +- .../mssql/mssql_failover_group_resource.go | 2 +- .../mssql/mssql_firewall_rule_resource.go | 2 +- .../mssql/mssql_job_agent_resource.go | 2 +- .../mssql/mssql_job_credential_resource.go | 2 +- .../mssql/mssql_managed_database_resource.go | 2 +- ...active_directory_administrator_resource.go | 2 +- .../mssql_managed_instance_data_source.go | 2 +- ...anaged_instance_failover_group_resource.go | 2 +- .../mssql/mssql_managed_instance_resource.go | 2 +- ...instance_security_alert_policy_resource.go | 6 +- ...tance_vulnerability_assessment_resource.go | 2 +- .../mssql_outbound_firewall_rule_resource.go | 2 +- ...erver_extended_auditing_policy_resource.go | 2 +- ...rosoft_support_auditing_policy_resource.go | 2 +- .../services/mssql/mssql_server_resource.go | 2 +- ...l_server_security_alert_policy_resource.go | 2 +- ...er_transparent_data_encryption_resource.go | 2 +- ...erver_vulnerability_assessment_resource.go | 2 +- .../mssql_virtual_network_rule_resource.go | 2 +- internal/services/mysql/client/client.go | 4 +- .../mysql/mysql_aad_administrator_resource.go | 2 +- .../mysql/mysql_configuration_resource.go | 2 +- .../services/mysql/mysql_database_resource.go | 2 +- .../mysql/mysql_firewall_rule_resource.go | 2 +- .../mysql/mysql_flexible_database_resource.go | 2 +- ..._flexible_server_configuration_resource.go | 2 +- .../mysql_flexible_server_data_source.go | 2 +- ..._flexible_server_firewall_rule_resource.go | 2 +- .../mysql/mysql_flexible_server_resource.go | 2 +- .../mysql/mysql_server_data_source.go | 2 +- .../mysql/mysql_server_key_resource.go | 2 +- .../services/mysql/mysql_server_resource.go | 2 +- .../mysql_virtual_network_rule_resource.go | 2 +- .../network/application_gateway_resource.go | 33 ++-- .../express_route_port_resource_test.go | 2 +- .../network_connection_monitor_resource.go | 12 +- internal/services/policy/assignment.go | 2 +- .../policy/assignment_base_resource.go | 4 +- .../services/policy/assignment_data_source.go | 2 +- internal/services/policy/client/client.go | 6 +- .../policy/exemption_management_group.go | 2 +- .../services/policy/exemption_resource.go | 2 +- .../policy/exemption_resource_group.go | 2 +- .../services/policy/exemption_subscription.go | 2 +- internal/services/policy/policy.go | 2 +- .../policy/policy_definition_data_source.go | 2 +- .../policy/policy_definition_resource.go | 2 +- .../policy/policy_definition_resource_test.go | 2 +- .../policy_set_definition_data_source.go | 2 +- .../policy/policy_set_definition_resource.go | 4 +- .../policy_set_definition_resource_test.go | 2 +- ...ne_configuration_assignment_data_source.go | 2 +- ...chine_configuration_assignment_resource.go | 2 +- .../policy/remediation_management_group.go | 2 +- .../services/policy/remediation_resource.go | 6 +- .../policy/remediation_resource_group.go | 4 +- .../policy/remediation_subscription.go | 2 +- .../private_dns_zone_data_source.go | 2 +- ...esolver_dns_forwarding_ruleset_resource.go | 26 +-- ...e_dns_resolver_forwarding_rule_resource.go | 28 +-- ..._dns_resolver_inbound_endpoint_resource.go | 26 +-- ...ckup_container_storage_account_resource.go | 2 +- .../backup_policy_file_share_resource.go | 2 +- .../backup_policy_vm_resource.go | 2 +- .../backup_policy_vm_resource_test.go | 1 + .../backup_policy_vm_workload_resource.go | 24 +-- .../backup_protected_file_share_resource.go | 2 +- .../backup_protected_vm_resource.go | 10 +- .../recoveryservices/client/client.go | 6 +- .../recovery_services_vault_resource.go | 4 +- .../site_recovery_fabric_resource.go | 2 +- .../site_recovery_network_mapping_resource.go | 2 +- ...y_protection_container_mapping_resource.go | 2 +- ..._recovery_protection_container_resource.go | 2 +- .../site_recovery_replicated_vm_resource.go | 2 +- ...te_recovery_replication_policy_resource.go | 2 +- internal/services/redis/client/client.go | 2 +- .../services/redis/redis_cache_resource.go | 2 +- .../redis/redis_firewall_rule_resource.go | 2 +- .../redis/redis_linked_server_resource.go | 2 +- .../redis_enterprise_cluster_sku_name.go | 2 +- internal/services/resource/client/client.go | 8 +- ...ment_group_template_deployment_resource.go | 4 +- .../resource/management_lock_resource.go | 2 +- .../resource/resource_group_resource.go | 2 +- ...urce_group_template_deployment_resource.go | 4 +- ...resource_provider_registration_resource.go | 2 +- .../resource/resources_data_source.go | 2 +- ...bscription_template_deployment_resource.go | 4 +- .../resource/template_deployment_common.go | 2 +- .../resource/template_deployment_resource.go | 2 +- .../tenant_template_deployment_resource.go | 4 +- .../advanced_threat_protection_resource.go | 2 +- ...dvanced_threat_protection_resource_test.go | 9 +- .../azuresdkhacks/security_center_contact.go | 2 +- .../azuresdkhacks/security_center_setting.go | 2 +- .../services/securitycenter/client/client.go | 2 +- .../iot_security_device_group_resource.go | 2 +- .../iot_security_solution_resource.go | 2 +- ...urity_center_assessment_policy_resource.go | 2 +- .../security_center_assessment_resource.go | 2 +- ...urity_center_auto_provisioning_resource.go | 2 +- .../security_center_automation_resource.go | 2 +- .../security_center_contact_resource.go | 2 +- ...erver_vulnerability_assessment_resource.go | 2 +- ...ity_assessment_virtual_machine_resource.go | 2 +- .../security_center_setting_resource.go | 2 +- .../security_center_setting_resource_test.go | 4 +- ...ty_center_subscription_pricing_resource.go | 2 +- ...nter_subscription_pricing_resource_test.go | 4 +- .../security_center_workspace_resource.go | 2 +- internal/services/sentinel/client/client.go | 2 +- ...entinel_alert_rule_template_data_source.go | 2 +- .../migration/namespace_network_rule_set.go | 5 +- .../servicebus_namespace_resource.go | 37 ++-- .../services/servicefabric/client/client.go | 2 +- .../service_fabric_cluster_resource.go | 2 +- internal/services/sql/client/client.go | 6 +- .../sql/sql_administrator_resource.go | 2 +- .../services/sql/sql_database_data_source.go | 2 +- .../services/sql/sql_database_resource.go | 2 +- .../services/sql/sql_elasticpool_resource.go | 2 +- .../sql/sql_failover_group_resource.go | 2 +- .../sql/sql_firewall_rule_resource.go | 2 +- .../sql/sql_managed_database_resource.go | 2 +- ...managed_instance_administrator_resource.go | 2 +- ...anaged_instance_failover_group_resource.go | 2 +- .../sql/sql_managed_instance_resource.go | 2 +- internal/services/sql/sql_server_resource.go | 2 +- .../sql/sql_virtual_network_rule_resource.go | 2 +- internal/services/storage/client/client.go | 4 +- internal/services/storage/client/helpers.go | 2 +- ...e_account_customer_managed_key_resource.go | 2 +- ...ount_customer_managed_key_resource_test.go | 2 +- .../storage/storage_account_data_source.go | 2 +- .../storage_account_network_rules_resource.go | 4 +- .../storage/storage_account_resource.go | 2 +- .../storage/storage_account_resource_test.go | 27 --- .../storage_blob_inventory_policy_resource.go | 2 +- .../storage_encryption_scope_resource.go | 2 +- .../storage_encryption_scope_resource_test.go | 2 +- .../storage_management_policy_resource.go | 8 +- .../storage_sync_cloud_endpoint_resource.go | 2 +- .../storage/storage_sync_group_resource.go | 2 +- .../services/storage/storage_sync_resource.go | 2 +- .../services/streamanalytics/client/client.go | 2 +- .../services/streamanalytics/helpers_input.go | 2 +- .../streamanalytics/helpers_output.go | 2 +- .../stream_analytics_cluster_resource.go | 2 +- ...lytics_function_javascript_uda_resource.go | 2 +- ...lytics_function_javascript_udf_resource.go | 2 +- .../stream_analytics_job_resource.go | 2 +- .../stream_analytics_job_schedule_resource.go | 2 +- ...ytics_managed_private_endpoint_resource.go | 2 +- .../stream_analytics_output.go | 2 +- .../stream_analytics_output_blob_resource.go | 2 +- ...ream_analytics_output_cosmosdb_resource.go | 2 +- ...ream_analytics_output_eventhub_resource.go | 2 +- ...ream_analytics_output_function_resource.go | 2 +- .../stream_analytics_output_mssql_resource.go | 2 +- ...tream_analytics_output_powerbi_resource.go | 2 +- ...lytics_output_servicebus_queue_resource.go | 2 +- ...lytics_output_servicebus_topic_resource.go | 2 +- ...s_output_servicebus_topic_resource_test.go | 24 --- ...tream_analytics_output_synapse_resource.go | 2 +- .../stream_analytics_output_table_resource.go | 4 +- .../stream_analytics_reference_input.go | 2 +- ...analytics_reference_input_blob_resource.go | 2 +- ...nalytics_reference_input_mssql_resource.go | 2 +- ...ics_reference_input_mssql_resource_test.go | 26 --- ...am_analytics_stream_input_blob_resource.go | 2 +- ...nalytics_stream_input_eventhub_resource.go | 2 +- ...ytics_stream_input_eventhub_v2_resource.go | 2 +- ..._analytics_stream_input_iothub_resource.go | 2 +- .../services/subscription/client/client.go | 4 +- .../extended_locations_data_source.go | 2 +- .../subscription/subscription_import.go | 2 +- .../subscription/subscription_resource.go | 6 +- internal/services/synapse/client/client.go | 2 +- .../synapse/synapse_firewall_rule_resource.go | 2 +- ...apse_integration_runtime_azure_resource.go | 2 +- ...ntegration_runtime_self_hosted_resource.go | 2 +- .../synapse_private_link_hub_resource.go | 2 +- .../synapse/synapse_spark_pool_resource.go | 2 +- ..._pool_extended_auditing_policy_resource.go | 2 +- .../synapse/synapse_sql_pool_resource.go | 2 +- ...sql_pool_security_alert_policy_resource.go | 2 +- ...nerability_assessment_baseline_resource.go | 2 +- ...ility_assessment_baseline_resource_test.go | 2 +- ..._pool_vulnerability_assessment_resource.go | 2 +- ...e_sql_pool_workload_classifier_resource.go | 2 +- ...ynapse_sql_pool_workload_group_resource.go | 2 +- .../synapse_workspace_aad_admin_resource.go | 2 +- ...space_extended_auditing_policy_resource.go | 2 +- .../synapse/synapse_workspace_key_resource.go | 2 +- .../synapse/synapse_workspace_resource.go | 2 +- .../synapse_workspace_resource_test.go | 37 ---- ...orkspace_security_alert_policy_resource.go | 2 +- ...ynapse_workspace_sql_aad_admin_resource.go | 2 +- ...space_vulnerability_assessment_resource.go | 2 +- ...ideo_analyzer_edge_module_resource_test.go | 6 +- .../video_analyzer_resource_test.go | 13 +- internal/services/web/app_service.go | 20 +-- .../web/app_service_active_slot_resource.go | 2 +- ...pp_service_certificate_binding_resource.go | 2 +- ...p_service_certificate_order_data_source.go | 2 +- .../app_service_certificate_order_resource.go | 2 +- .../web/app_service_certificate_resource.go | 2 +- ...ervice_custom_hostname_binding_resource.go | 2 +- .../web/app_service_environment_resource.go | 2 +- .../app_service_environment_v3_resource.go | 2 +- .../app_service_hybrid_connection_resource.go | 2 +- ...pp_service_managed_certificate_resource.go | 2 +- .../services/web/app_service_plan_resource.go | 2 +- ...app_service_public_certificate_resource.go | 2 +- internal/services/web/app_service_resource.go | 2 +- .../services/web/app_service_resource_test.go | 2 +- .../web/app_service_schedule_backup.go | 2 +- .../web/app_service_site_source_control.go | 2 +- ...e_slot_custom_hostname_binding_resource.go | 2 +- .../services/web/app_service_slot_resource.go | 2 +- .../web/app_service_slot_resource_test.go | 2 +- ...rtual_network_swift_connection_resource.go | 2 +- ...p_service_source_control_token_resource.go | 2 +- ...rtual_network_swift_connection_resource.go | 2 +- internal/services/web/client/client.go | 2 +- internal/services/web/cors_settings.go | 2 +- internal/services/web/function_app.go | 2 +- .../services/web/function_app_data_source.go | 2 +- .../services/web/function_app_resource.go | 2 +- .../web/function_app_slot_resource.go | 2 +- .../web/static_site_custom_domain_resource.go | 2 +- internal/services/web/static_site_resource.go | 2 +- internal/tags/validation.go | 1 + main.go | 1 + scripts/run-gradually-deprecated.sh | 164 +++++++++--------- 783 files changed, 1197 insertions(+), 1707 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index b8d6dda80d54..fb1c545b4768 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -5,7 +5,7 @@ run: skip-dirs: - /sdk/ # Excluding sdk folders as these are externally generated skip-files: - - ".*\\*_gen.go$" + - "internal/services/.*/.*_gen.go$" issues: max-per-linter: 0 diff --git a/contributing/topics/guide-new-data-source.md b/contributing/topics/guide-new-data-source.md index b6385c92359b..b77765e7b9fa 100644 --- a/contributing/topics/guide-new-data-source.md +++ b/contributing/topics/guide-new-data-source.md @@ -43,7 +43,7 @@ The Client for the Service Package can be found in `./internal/services/{name}/c package client import ( - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/contributing/topics/guide-new-resource.md b/contributing/topics/guide-new-resource.md index a453b82182b6..56b3a70c3072 100644 --- a/contributing/topics/guide-new-resource.md +++ b/contributing/topics/guide-new-resource.md @@ -41,7 +41,7 @@ The Client for the Service Package can be found in `./internal/services/{name}/c package client import ( - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) @@ -357,7 +357,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" diff --git a/internal/acceptance/testing.go b/internal/acceptance/testing.go index 3d022d96ff86..3f25cb7011e8 100644 --- a/internal/acceptance/testing.go +++ b/internal/acceptance/testing.go @@ -47,8 +47,8 @@ func Environment() (*azure.Environment, error) { } func GetAuthConfig(t *testing.T) *authentication.Config { - if os.Getenv(resource.TestEnvVar) == "" { - t.Skip(fmt.Sprintf("Integration test skipped unless env '%s' set", resource.TestEnvVar)) + if os.Getenv(resource.EnvTfAcc) == "" { + t.Skipf("Integration test skipped unless env '%s' set", resource.EnvTfAcc) return nil } diff --git a/internal/clients/client.go b/internal/clients/client.go index 16a104039f9d..d8f2f3e8a80d 100644 --- a/internal/clients/client.go +++ b/internal/clients/client.go @@ -2,7 +2,6 @@ package clients import ( "context" - "fmt" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/validation" @@ -244,9 +243,7 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error // Disable the Azure SDK for Go's validation since it's unhelpful for our use-case validation.Disabled = true - if err := buildAutoClients(&client.autoClient, o); err != nil { - return fmt.Errorf("building auto-sdk clients: %+v", err) - } + buildAutoClients(&client.autoClient, o) client.Features = o.Features client.StopContext = ctx diff --git a/internal/clients/client_gen.go b/internal/clients/client_gen.go index ae043a1995cf..12c713ed5557 100644 --- a/internal/clients/client_gen.go +++ b/internal/clients/client_gen.go @@ -18,9 +18,8 @@ type autoClient struct { ManagedIdentity *managedidentity_v2022_01_31_preview.Client } -func buildAutoClients(client *autoClient, o *common.ClientOptions) error { +func buildAutoClients(client *autoClient, o *common.ClientOptions) { client.ContainerService = containers.NewClient(o) client.LoadTestService = loadtestservice.NewClient(o) client.ManagedIdentity = managedidentity.NewClient(o) - return nil } diff --git a/internal/sdk/README.md b/internal/sdk/README.md index 06abcf545524..3789aabe8000 100644 --- a/internal/sdk/README.md +++ b/internal/sdk/README.md @@ -28,7 +28,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" diff --git a/internal/sdk/logger_console.go b/internal/sdk/logger_console.go index 2233705c181f..7771a7c80281 100644 --- a/internal/sdk/logger_console.go +++ b/internal/sdk/logger_console.go @@ -13,7 +13,7 @@ type ConsoleLogger struct{} // Info prints out a message prefixed with `[INFO]` verbatim func (ConsoleLogger) Info(message string) { - log.Print(fmt.Sprintf("[INFO] %s", message)) + log.Printf("[INFO] %s", message) } // Infof prints out a message prefixed with `[INFO]` formatted @@ -24,7 +24,7 @@ func (l ConsoleLogger) Infof(format string, args ...interface{}) { // Warn prints out a message prefixed with `[WARN]` formatted verbatim func (l ConsoleLogger) Warn(message string) { - log.Print(fmt.Sprintf("[WARN] %s", message)) + log.Printf("[WARN] %s", message) } // Warnf prints out a message prefixed with `[WARN]` formatted diff --git a/internal/sdk/plugin_sdk_test.go b/internal/sdk/plugin_sdk_test.go index 55acd3992d2a..22d2a611e3e0 100644 --- a/internal/sdk/plugin_sdk_test.go +++ b/internal/sdk/plugin_sdk_test.go @@ -60,7 +60,7 @@ func TestAccPluginSDKAndDecoder(t *testing.T) { }, } - //lintignore:AT001 + // lintignore:AT001 resource.ParallelTest(t, resource.TestCase{ ProviderFactories: map[string]func() (*schema.Provider, error){ "validator": func() (*schema.Provider, error) { //nolint:unparam @@ -150,7 +150,7 @@ func TestAccPluginSDKAndDecoder(t *testing.T) { }, }, }, - Create: func(d *schema.ResourceData, i interface{}) error { //nolint:SA1019 + Create: func(d *schema.ResourceData, i interface{}) error { d.SetId("some-id") d.Set("hello", "world") d.Set("random_number", 42) @@ -178,7 +178,7 @@ func TestAccPluginSDKAndDecoder(t *testing.T) { }) return nil }, - Read: func(d *schema.ResourceData, _ interface{}) error { //nolint:SA1019 + Read: func(d *schema.ResourceData, _ interface{}) error { //nolint:staticcheck wrapper := ResourceMetaData{ ResourceData: d, Logger: ConsoleLogger{}, @@ -196,7 +196,7 @@ func TestAccPluginSDKAndDecoder(t *testing.T) { return nil }, - Delete: func(_ *schema.ResourceData, _ interface{}) error { //nolint:SA1019 + Delete: func(_ *schema.ResourceData, _ interface{}) error { //nolint:staticcheck return nil }, }, @@ -260,7 +260,7 @@ func TestAccPluginSDKAndDecoderOptionalComputed(t *testing.T) { } } - //lintignore:AT001 + // lintignore:AT001 resource.ParallelTest(t, resource.TestCase{ ProviderFactories: map[string]func() (*schema.Provider, error){ "validator": func() (*schema.Provider, error) { //nolint:unparam @@ -269,7 +269,7 @@ func TestAccPluginSDKAndDecoderOptionalComputed(t *testing.T) { ResourcesMap: map[string]*schema.Resource{ "validator_decoder_specified": { Schema: commonSchema, - Create: func(d *schema.ResourceData, i interface{}) error { //nolint:SA1019 + Create: func(d *schema.ResourceData, i interface{}) error { //nolint:staticcheck d.SetId("some-id") return nil }, @@ -285,7 +285,7 @@ func TestAccPluginSDKAndDecoderOptionalComputed(t *testing.T) { "validator_decoder_unspecified": { Schema: commonSchema, - Create: func(d *schema.ResourceData, i interface{}) error { //nolint:SA1019 + Create: func(d *schema.ResourceData, i interface{}) error { //nolint:staticcheck d.SetId("some-id") d.Set("hello", "value-from-create") d.Set("number", 42) @@ -346,7 +346,7 @@ func TestAccPluginSDKAndDecoderOptionalComputedOverride(t *testing.T) { // TODO: do we need other field types, or is this sufficient? } - //lintignore:AT001 + // lintignore:AT001 resource.ParallelTest(t, resource.TestCase{ ProviderFactories: map[string]func() (*schema.Provider, error){ "validator": func() (*schema.Provider, error) { //nolint:unparam @@ -371,7 +371,7 @@ func TestAccPluginSDKAndDecoderOptionalComputedOverride(t *testing.T) { Computed: true, }, }, - Create: func(d *schema.ResourceData, i interface{}) error { //nolint:SA1019 + Create: func(d *schema.ResourceData, i interface{}) error { //nolint:staticcheck d.SetId("some-id") d.Set("hello", "value-from-create") d.Set("number", 42) @@ -452,7 +452,7 @@ func TestAccPluginSDKAndDecoderSets(t *testing.T) { // so we should be covered via this test alone } - //lintignore:AT001 + // lintignore:AT001 resource.ParallelTest(t, resource.TestCase{ ProviderFactories: map[string]func() (*schema.Provider, error){ "validator": func() (*schema.Provider, error) { //nolint:unparam @@ -490,7 +490,7 @@ func TestAccPluginSDKAndDecoderSets(t *testing.T) { }, }, }, - Create: func(d *schema.ResourceData, i interface{}) error { //nolint:SA1019 + Create: func(d *schema.ResourceData, i interface{}) error { //nolint:staticcheck d.SetId("some-id") d.Set("set_of_strings", []string{ "some", @@ -645,7 +645,7 @@ func TestAccPluginSDKAndEncoder(t *testing.T) { SetOfFloats []float64 `tfschema:"set_of_floats"` } - //lintignore:AT001 + // lintignore:AT001 resource.ParallelTest(t, resource.TestCase{ ProviderFactories: map[string]func() (*schema.Provider, error){ "validator": func() (*schema.Provider, error) { //nolint:unparam @@ -763,7 +763,7 @@ func TestAccPluginSDKAndEncoder(t *testing.T) { }, }, }, - Create: func(d *schema.ResourceData, i interface{}) error { //nolint:SA1019 + Create: func(d *schema.ResourceData, i interface{}) error { //nolint:staticcheck wrapper := ResourceMetaData{ ResourceData: d, Logger: ConsoleLogger{}, @@ -863,7 +863,7 @@ func TestAccPluginSDKReturnsComputedFields(t *testing.T) { os.Setenv("TF_ACC", "1") resourceName := "validator_computed.test" - //lintignore:AT001 + // lintignore:AT001 resource.ParallelTest(t, resource.TestCase{ ProviderFactories: map[string]func() (*schema.Provider, error){ "validator": func() (*schema.Provider, error) { //nolint:unparam @@ -980,7 +980,7 @@ func computedFieldsResource() *schema.Resource { }, }, }, - Create: func(d *schema.ResourceData, meta interface{}) error { //nolint:SA1019 + Create: func(d *schema.ResourceData, meta interface{}) error { //nolint:staticcheck d.SetId("does-not-matter") return readFunc(d, meta) }, diff --git a/internal/services/advisor/advisor_recommendations_data_source.go b/internal/services/advisor/advisor_recommendations_data_source.go index d32a3a368f16..56ebc692cb97 100644 --- a/internal/services/advisor/advisor_recommendations_data_source.go +++ b/internal/services/advisor/advisor_recommendations_data_source.go @@ -5,7 +5,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/advisor/mgmt/2020-01-01/advisor" + "github.com/Azure/azure-sdk-for-go/services/advisor/mgmt/2020-01-01/advisor" // nolint: staticcheck "github.com/gofrs/uuid" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/advisor/client/client.go b/internal/services/advisor/client/client.go index eb334883655d..e64c96e06ad8 100644 --- a/internal/services/advisor/client/client.go +++ b/internal/services/advisor/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/advisor/mgmt/2020-01-01/advisor" + "github.com/Azure/azure-sdk-for-go/services/advisor/mgmt/2020-01-01/advisor" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/analysisservices/analysis_services_server_resource_test.go b/internal/services/analysisservices/analysis_services_server_resource_test.go index 6a6f268ccd77..46abf29602a0 100644 --- a/internal/services/analysisservices/analysis_services_server_resource_test.go +++ b/internal/services/analysisservices/analysis_services_server_resource_test.go @@ -126,7 +126,7 @@ func TestAccAzureRMAnalysisServicesServer_adminUsers(t *testing.T) { const ArmAccAdminEmail2 = "ARM_ACCTEST_ADMIN_EMAIL2" if os.Getenv(ArmAccAdminEmail1) == "" || os.Getenv(ArmAccAdminEmail2) == "" { - t.Skip(fmt.Sprintf("Acceptance test skipped unless env '%s' and '%s' set", ArmAccAdminEmail1, ArmAccAdminEmail2)) + t.Skipf("Acceptance test skipped unless env '%s' and '%s' set", ArmAccAdminEmail1, ArmAccAdminEmail2) return } diff --git a/internal/services/apimanagement/api_management_api_data_source.go b/internal/services/apimanagement/api_management_api_data_source.go index 25bd95d971c4..494e3d1ab612 100644 --- a/internal/services/apimanagement/api_management_api_data_source.go +++ b/internal/services/apimanagement/api_management_api_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse" diff --git a/internal/services/apimanagement/api_management_api_diagnostic_resource.go b/internal/services/apimanagement/api_management_api_diagnostic_resource.go index d829cfc6d3cc..24853c987a58 100644 --- a/internal/services/apimanagement/api_management_api_diagnostic_resource.go +++ b/internal/services/apimanagement/api_management_api_diagnostic_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -124,7 +124,7 @@ func resourceApiManagementApiDiagnostic() *pluginsdk.Resource { } func resourceApiManagementApiDiagnosticAdditionalContentSchema() *pluginsdk.Schema { - //lintignore:XS003 + // lintignore:XS003 return &pluginsdk.Schema{ Type: pluginsdk.TypeList, MaxItems: 1, diff --git a/internal/services/apimanagement/api_management_api_operation_policy_resource.go b/internal/services/apimanagement/api_management_api_operation_policy_resource.go index ea79f68aa332..d36c7fe2c4d6 100644 --- a/internal/services/apimanagement/api_management_api_operation_policy_resource.go +++ b/internal/services/apimanagement/api_management_api_operation_policy_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_api_operation_policy_resource_test.go b/internal/services/apimanagement/api_management_api_operation_policy_resource_test.go index 2a37ca6e5224..7cd533192e58 100644 --- a/internal/services/apimanagement/api_management_api_operation_policy_resource_test.go +++ b/internal/services/apimanagement/api_management_api_operation_policy_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_api_operation_resource.go b/internal/services/apimanagement/api_management_api_operation_resource.go index 7e52908ea569..6a9c032a3f52 100644 --- a/internal/services/apimanagement/api_management_api_operation_resource.go +++ b/internal/services/apimanagement/api_management_api_operation_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_api_operation_tag_resource.go b/internal/services/apimanagement/api_management_api_operation_tag_resource.go index 6eeb705adfa4..bb9c042d2935 100644 --- a/internal/services/apimanagement/api_management_api_operation_tag_resource.go +++ b/internal/services/apimanagement/api_management_api_operation_tag_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse" diff --git a/internal/services/apimanagement/api_management_api_policy_resource.go b/internal/services/apimanagement/api_management_api_policy_resource.go index 82fe7be34ec6..7df4ba936aa3 100644 --- a/internal/services/apimanagement/api_management_api_policy_resource.go +++ b/internal/services/apimanagement/api_management_api_policy_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_api_policy_resource_test.go b/internal/services/apimanagement/api_management_api_policy_resource_test.go index e021d763d617..1e3bc38bdfcc 100644 --- a/internal/services/apimanagement/api_management_api_policy_resource_test.go +++ b/internal/services/apimanagement/api_management_api_policy_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_api_release.go b/internal/services/apimanagement/api_management_api_release.go index f50072a2cddf..f059c5579b81 100644 --- a/internal/services/apimanagement/api_management_api_release.go +++ b/internal/services/apimanagement/api_management_api_release.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse" diff --git a/internal/services/apimanagement/api_management_api_resource.go b/internal/services/apimanagement/api_management_api_resource.go index 58f423cf0155..8fdda6bfc444 100644 --- a/internal/services/apimanagement/api_management_api_resource.go +++ b/internal/services/apimanagement/api_management_api_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_api_schema_resource.go b/internal/services/apimanagement/api_management_api_schema_resource.go index 8372360d0e22..9fa825f14282 100644 --- a/internal/services/apimanagement/api_management_api_schema_resource.go +++ b/internal/services/apimanagement/api_management_api_schema_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_api_schema_resource_test.go b/internal/services/apimanagement/api_management_api_schema_resource_test.go index 7c4722f6c3e0..1476be504d94 100644 --- a/internal/services/apimanagement/api_management_api_schema_resource_test.go +++ b/internal/services/apimanagement/api_management_api_schema_resource_test.go @@ -215,17 +215,3 @@ resource "azurerm_api_management_api_schema" "test" { } `, r.template(data), data.RandomInteger) } -func (r ApiManagementApiSchemaResource) definitionsYaml(data acceptance.TestData) string { - return fmt.Sprintf(` -%s - -resource "azurerm_api_management_api_schema" "test" { - api_name = azurerm_api_management_api.test.name - api_management_name = azurerm_api_management_api.test.api_management_name - resource_group_name = azurerm_api_management_api.test.resource_group_name - schema_id = "acctestSchema%d" - content_type = "application/vnd.ms-azure-apim.swagger.definitions+json" - definitions = file("testdata/api_management_api_swagger_definitions.yaml") -} -`, r.template(data), data.RandomInteger) -} diff --git a/internal/services/apimanagement/api_management_api_tag_description_resource.go b/internal/services/apimanagement/api_management_api_tag_description_resource.go index 2bc6d1072f91..57beffd23e10 100644 --- a/internal/services/apimanagement/api_management_api_tag_description_resource.go +++ b/internal/services/apimanagement/api_management_api_tag_description_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse" diff --git a/internal/services/apimanagement/api_management_api_version_set_resource.go b/internal/services/apimanagement/api_management_api_version_set_resource.go index 04c5ee4ee6da..2fc0bad0dc40 100644 --- a/internal/services/apimanagement/api_management_api_version_set_resource.go +++ b/internal/services/apimanagement/api_management_api_version_set_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_authorization_server_resource.go b/internal/services/apimanagement/api_management_authorization_server_resource.go index 8b6b25beead1..63d5ba52c16a 100644 --- a/internal/services/apimanagement/api_management_authorization_server_resource.go +++ b/internal/services/apimanagement/api_management_authorization_server_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_backend_resource.go b/internal/services/apimanagement/api_management_backend_resource.go index f75aff48b981..1403ab5a18c7 100644 --- a/internal/services/apimanagement/api_management_backend_resource.go +++ b/internal/services/apimanagement/api_management_backend_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_certificate_resource.go b/internal/services/apimanagement/api_management_certificate_resource.go index 5630f72c46ed..4f8b4a14f669 100644 --- a/internal/services/apimanagement/api_management_certificate_resource.go +++ b/internal/services/apimanagement/api_management_certificate_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_custom_domain_resource.go b/internal/services/apimanagement/api_management_custom_domain_resource.go index 2e5bbc06794e..a242c8a1842e 100644 --- a/internal/services/apimanagement/api_management_custom_domain_resource.go +++ b/internal/services/apimanagement/api_management_custom_domain_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -194,7 +194,7 @@ func apiManagementCustomDomainRead(d *pluginsdk.ResourceData, meta interface{}) configs := flattenApiManagementHostnameConfiguration(resp.ServiceProperties.HostnameConfigurations, d, *resp.Name, apimHostNameSuffix) for _, config := range configs { for key, v := range config.(map[string]interface{}) { - //lintignore:R001 + // lintignore:R001 if err := d.Set(key, v); err != nil { return fmt.Errorf("setting `hostname_configuration` %q: %+v", key, err) } diff --git a/internal/services/apimanagement/api_management_data_source.go b/internal/services/apimanagement/api_management_data_source.go index ce528f60c3d8..99a42c46646d 100644 --- a/internal/services/apimanagement/api_management_data_source.go +++ b/internal/services/apimanagement/api_management_data_source.go @@ -5,7 +5,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-helpers/resourcemanager/zones" diff --git a/internal/services/apimanagement/api_management_diagnostic_resource.go b/internal/services/apimanagement/api_management_diagnostic_resource.go index 9261769cc7ef..19003e3bcdd2 100644 --- a/internal/services/apimanagement/api_management_diagnostic_resource.go +++ b/internal/services/apimanagement/api_management_diagnostic_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_email_template_resource.go b/internal/services/apimanagement/api_management_email_template_resource.go index f101473480d7..98b61ffbe8df 100644 --- a/internal/services/apimanagement/api_management_email_template_resource.go +++ b/internal/services/apimanagement/api_management_email_template_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/apimanagement/api_management_email_template_resource_test.go b/internal/services/apimanagement/api_management_email_template_resource_test.go index 23aa687a369e..00fe56d5fdfd 100644 --- a/internal/services/apimanagement/api_management_email_template_resource_test.go +++ b/internal/services/apimanagement/api_management_email_template_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_gateway_api_resource.go b/internal/services/apimanagement/api_management_gateway_api_resource.go index 7893b3aff627..e0a16e10457a 100644 --- a/internal/services/apimanagement/api_management_gateway_api_resource.go +++ b/internal/services/apimanagement/api_management_gateway_api_resource.go @@ -6,7 +6,7 @@ import ( "net/http" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_gateway_certificate_authority_resource.go b/internal/services/apimanagement/api_management_gateway_certificate_authority_resource.go index 4fa00c2e78af..c2fe787ebdeb 100644 --- a/internal/services/apimanagement/api_management_gateway_certificate_authority_resource.go +++ b/internal/services/apimanagement/api_management_gateway_certificate_authority_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse" diff --git a/internal/services/apimanagement/api_management_gateway_host_name_configuration_resource.go b/internal/services/apimanagement/api_management_gateway_host_name_configuration_resource.go index 086dce934e96..d09091596f96 100644 --- a/internal/services/apimanagement/api_management_gateway_host_name_configuration_resource.go +++ b/internal/services/apimanagement/api_management_gateway_host_name_configuration_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse" diff --git a/internal/services/apimanagement/api_management_gateway_resource.go b/internal/services/apimanagement/api_management_gateway_resource.go index 1b51abd7bffe..9b1d56591adc 100644 --- a/internal/services/apimanagement/api_management_gateway_resource.go +++ b/internal/services/apimanagement/api_management_gateway_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse" diff --git a/internal/services/apimanagement/api_management_group_resource.go b/internal/services/apimanagement/api_management_group_resource.go index 8148868bb7c3..738ed8148995 100644 --- a/internal/services/apimanagement/api_management_group_resource.go +++ b/internal/services/apimanagement/api_management_group_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_identity_provider_aad_resource.go b/internal/services/apimanagement/api_management_identity_provider_aad_resource.go index 9c3c74b061b0..61964ef40e7b 100644 --- a/internal/services/apimanagement/api_management_identity_provider_aad_resource.go +++ b/internal/services/apimanagement/api_management_identity_provider_aad_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_identity_provider_aad_resource_test.go b/internal/services/apimanagement/api_management_identity_provider_aad_resource_test.go index 51123509ccbb..e03d01210384 100644 --- a/internal/services/apimanagement/api_management_identity_provider_aad_resource_test.go +++ b/internal/services/apimanagement/api_management_identity_provider_aad_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_identity_provider_aadb2c_resource.go b/internal/services/apimanagement/api_management_identity_provider_aadb2c_resource.go index b0e82d8effb5..931ea0f456a5 100644 --- a/internal/services/apimanagement/api_management_identity_provider_aadb2c_resource.go +++ b/internal/services/apimanagement/api_management_identity_provider_aadb2c_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_identity_provider_aadb2c_resource_test.go b/internal/services/apimanagement/api_management_identity_provider_aadb2c_resource_test.go index e7fd877b8826..93e416c926ce 100644 --- a/internal/services/apimanagement/api_management_identity_provider_aadb2c_resource_test.go +++ b/internal/services/apimanagement/api_management_identity_provider_aadb2c_resource_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -81,7 +81,7 @@ func testAccAzureRMApiManagementIdentityProviderAADB2C_getB2CConfig(t *testing.T v := fmt.Sprintf("ARM_TEST_B2C_%s", strings.ToUpper(k)) vars = append(vars, v) } - t.Skip(fmt.Sprintf("Acceptance tests for resource `azurerm_api_management_identity_provider_aadb2c` skipped unless environment variables set: %s", strings.Join(vars, ", "))) + t.Skipf("Acceptance tests for resource `azurerm_api_management_identity_provider_aadb2c` skipped unless environment variables set: %s", strings.Join(vars, ", ")) } return config diff --git a/internal/services/apimanagement/api_management_identity_provider_facebook_resource.go b/internal/services/apimanagement/api_management_identity_provider_facebook_resource.go index 9648c6322eec..4e2ad9a060e1 100644 --- a/internal/services/apimanagement/api_management_identity_provider_facebook_resource.go +++ b/internal/services/apimanagement/api_management_identity_provider_facebook_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_identity_provider_facebook_resource_test.go b/internal/services/apimanagement/api_management_identity_provider_facebook_resource_test.go index 48cae792fbf1..60b976e1d521 100644 --- a/internal/services/apimanagement/api_management_identity_provider_facebook_resource_test.go +++ b/internal/services/apimanagement/api_management_identity_provider_facebook_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_identity_provider_google_resource.go b/internal/services/apimanagement/api_management_identity_provider_google_resource.go index fed4df365556..016b91fbdcb8 100644 --- a/internal/services/apimanagement/api_management_identity_provider_google_resource.go +++ b/internal/services/apimanagement/api_management_identity_provider_google_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_identity_provider_google_resource_test.go b/internal/services/apimanagement/api_management_identity_provider_google_resource_test.go index 5a89cad327c1..f05ac0c6b6c2 100644 --- a/internal/services/apimanagement/api_management_identity_provider_google_resource_test.go +++ b/internal/services/apimanagement/api_management_identity_provider_google_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_identity_provider_microsoft_resource.go b/internal/services/apimanagement/api_management_identity_provider_microsoft_resource.go index 078e717c0825..75b4f27e6dba 100644 --- a/internal/services/apimanagement/api_management_identity_provider_microsoft_resource.go +++ b/internal/services/apimanagement/api_management_identity_provider_microsoft_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_identity_provider_microsoft_resource_test.go b/internal/services/apimanagement/api_management_identity_provider_microsoft_resource_test.go index 01596b5f71be..0ec2b44a9af9 100644 --- a/internal/services/apimanagement/api_management_identity_provider_microsoft_resource_test.go +++ b/internal/services/apimanagement/api_management_identity_provider_microsoft_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_identity_provider_twitter_resource.go b/internal/services/apimanagement/api_management_identity_provider_twitter_resource.go index a72c88114467..7d4e3ac047ec 100644 --- a/internal/services/apimanagement/api_management_identity_provider_twitter_resource.go +++ b/internal/services/apimanagement/api_management_identity_provider_twitter_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_identity_provider_twitter_resource_test.go b/internal/services/apimanagement/api_management_identity_provider_twitter_resource_test.go index 9779a5182139..ff3ad5488f1c 100644 --- a/internal/services/apimanagement/api_management_identity_provider_twitter_resource_test.go +++ b/internal/services/apimanagement/api_management_identity_provider_twitter_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_logger_resource.go b/internal/services/apimanagement/api_management_logger_resource.go index b065f2a792b4..55bbbe3dfc71 100644 --- a/internal/services/apimanagement/api_management_logger_resource.go +++ b/internal/services/apimanagement/api_management_logger_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/apimanagement/api_management_named_value_resource.go b/internal/services/apimanagement/api_management_named_value_resource.go index 3c53fd1f0271..0a07131dfca0 100644 --- a/internal/services/apimanagement/api_management_named_value_resource.go +++ b/internal/services/apimanagement/api_management_named_value_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_notification_recipient_email.go b/internal/services/apimanagement/api_management_notification_recipient_email.go index 5620e7025a5d..5b701b660bc9 100644 --- a/internal/services/apimanagement/api_management_notification_recipient_email.go +++ b/internal/services/apimanagement/api_management_notification_recipient_email.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse" diff --git a/internal/services/apimanagement/api_management_notification_recipient_email_test.go b/internal/services/apimanagement/api_management_notification_recipient_email_test.go index 8d2eb39a5195..02e22bd12979 100644 --- a/internal/services/apimanagement/api_management_notification_recipient_email_test.go +++ b/internal/services/apimanagement/api_management_notification_recipient_email_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_notification_recipient_user.go b/internal/services/apimanagement/api_management_notification_recipient_user.go index f1f5b5225cb5..96fa494fde81 100644 --- a/internal/services/apimanagement/api_management_notification_recipient_user.go +++ b/internal/services/apimanagement/api_management_notification_recipient_user.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse" diff --git a/internal/services/apimanagement/api_management_notification_recipient_user_test.go b/internal/services/apimanagement/api_management_notification_recipient_user_test.go index a6b114a896b0..676de534ce22 100644 --- a/internal/services/apimanagement/api_management_notification_recipient_user_test.go +++ b/internal/services/apimanagement/api_management_notification_recipient_user_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_openid_connect_provider_resource.go b/internal/services/apimanagement/api_management_openid_connect_provider_resource.go index fa1801d9a83e..d39ab6ac6fe4 100644 --- a/internal/services/apimanagement/api_management_openid_connect_provider_resource.go +++ b/internal/services/apimanagement/api_management_openid_connect_provider_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_policy_resource.go b/internal/services/apimanagement/api_management_policy_resource.go index dbcafed3ec19..8ea07ed53595 100644 --- a/internal/services/apimanagement/api_management_policy_resource.go +++ b/internal/services/apimanagement/api_management_policy_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/migration" diff --git a/internal/services/apimanagement/api_management_product_data_source.go b/internal/services/apimanagement/api_management_product_data_source.go index c9447bdf2196..31ca0844d20a 100644 --- a/internal/services/apimanagement/api_management_product_data_source.go +++ b/internal/services/apimanagement/api_management_product_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse" diff --git a/internal/services/apimanagement/api_management_product_policy_resource.go b/internal/services/apimanagement/api_management_product_policy_resource.go index 4558c52be04a..64ff77e04af0 100644 --- a/internal/services/apimanagement/api_management_product_policy_resource.go +++ b/internal/services/apimanagement/api_management_product_policy_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_product_policy_resource_test.go b/internal/services/apimanagement/api_management_product_policy_resource_test.go index 3a7eea9521b8..30e7d3fad2c2 100644 --- a/internal/services/apimanagement/api_management_product_policy_resource_test.go +++ b/internal/services/apimanagement/api_management_product_policy_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_product_resource.go b/internal/services/apimanagement/api_management_product_resource.go index 8636d2480b59..7135e47cf184 100644 --- a/internal/services/apimanagement/api_management_product_resource.go +++ b/internal/services/apimanagement/api_management_product_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/api_management_redis_cache_resource.go b/internal/services/apimanagement/api_management_redis_cache_resource.go index 9bd1a044cc26..c8bbbf5762da 100644 --- a/internal/services/apimanagement/api_management_redis_cache_resource.go +++ b/internal/services/apimanagement/api_management_redis_cache_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/apimanagement/api_management_resource.go b/internal/services/apimanagement/api_management_resource.go index debbd49b24d9..51b68ff16d70 100644 --- a/internal/services/apimanagement/api_management_resource.go +++ b/internal/services/apimanagement/api_management_resource.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" @@ -446,7 +446,7 @@ func resourceApiManagementSchema() map[string]*pluginsdk.Schema { }, }, - //lintignore:XS003 + // lintignore:XS003 "policy": { Type: pluginsdk.TypeList, Optional: true, @@ -947,7 +947,6 @@ func resourceApiManagementServiceRead(d *pluginsdk.ResourceData, meta interface{ signInClient := meta.(*clients.Client).ApiManagement.SignInClient signUpClient := meta.(*clients.Client).ApiManagement.SignUpClient tenantAccessClient := meta.(*clients.Client).ApiManagement.TenantAccessClient - environment := meta.(*clients.Client).Account.Environment ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() @@ -1020,8 +1019,7 @@ func resourceApiManagementServiceRead(d *pluginsdk.ResourceData, meta interface{ return fmt.Errorf("setting `protocols`: %+v", err) } - apimHostNameSuffix := environment.APIManagementHostNameSuffix - hostnameConfigs := flattenApiManagementHostnameConfigurations(props.HostnameConfigurations, d, id.ServiceName, apimHostNameSuffix) + hostnameConfigs := flattenApiManagementHostnameConfigurations(props.HostnameConfigurations, d) if err := d.Set("hostname_configuration", hostnameConfigs); err != nil { return fmt.Errorf("setting `hostname_configuration`: %+v", err) } @@ -1256,7 +1254,7 @@ func expandApiManagementCommonHostnameConfiguration(input map[string]interface{} return output } -func flattenApiManagementHostnameConfigurations(input *[]apimanagement.HostnameConfiguration, d *pluginsdk.ResourceData, name, apimHostNameSuffix string) []interface{} { +func flattenApiManagementHostnameConfigurations(input *[]apimanagement.HostnameConfiguration, d *pluginsdk.ResourceData) []interface{} { results := make([]interface{}, 0) if input == nil { return results diff --git a/internal/services/apimanagement/api_management_subscription_resource.go b/internal/services/apimanagement/api_management_subscription_resource.go index 7e112d3b00a7..47d2da8086b2 100644 --- a/internal/services/apimanagement/api_management_subscription_resource.go +++ b/internal/services/apimanagement/api_management_subscription_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/Azure/go-autorest/autorest" "github.com/gofrs/uuid" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" diff --git a/internal/services/apimanagement/api_management_tag_resource.go b/internal/services/apimanagement/api_management_tag_resource.go index 55365d9113f3..8250a886f153 100644 --- a/internal/services/apimanagement/api_management_tag_resource.go +++ b/internal/services/apimanagement/api_management_tag_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse" diff --git a/internal/services/apimanagement/api_management_user_resource.go b/internal/services/apimanagement/api_management_user_resource.go index d2596b13ee32..fe8ad623fd1e 100644 --- a/internal/services/apimanagement/api_management_user_resource.go +++ b/internal/services/apimanagement/api_management_user_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/apimanagement/client/client.go b/internal/services/apimanagement/client/client.go index dc8df51cdbdc..dfa91a58207a 100644 --- a/internal/services/apimanagement/client/client.go +++ b/internal/services/apimanagement/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck pandoraAPIMGlobalSchema "github.com/hashicorp/go-azure-sdk/resource-manager/apimanagement/2021-08-01/schema" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/apimanagement/identity_provider_import.go b/internal/services/apimanagement/identity_provider_import.go index 2d19f3ac713c..b7b4915331f2 100644 --- a/internal/services/apimanagement/identity_provider_import.go +++ b/internal/services/apimanagement/identity_provider_import.go @@ -3,7 +3,7 @@ package apimanagement import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/apimanagement/migration/policy.go b/internal/services/apimanagement/migration/policy.go index c52c6e5e4898..a9190dfb0dec 100644 --- a/internal/services/apimanagement/migration/policy.go +++ b/internal/services/apimanagement/migration/policy.go @@ -5,7 +5,7 @@ import ( "fmt" "html" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/apimanagement/schemaz/api_management.go b/internal/services/apimanagement/schemaz/api_management.go index 710a43cb1b42..2b682ff791bf 100644 --- a/internal/services/apimanagement/schemaz/api_management.go +++ b/internal/services/apimanagement/schemaz/api_management.go @@ -5,7 +5,7 @@ import ( "fmt" "strings" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" diff --git a/internal/services/appconfiguration/app_configuration_keys_data_source_test.go b/internal/services/appconfiguration/app_configuration_keys_data_source_test.go index eab859e81be5..54bb40e3b3eb 100644 --- a/internal/services/appconfiguration/app_configuration_keys_data_source_test.go +++ b/internal/services/appconfiguration/app_configuration_keys_data_source_test.go @@ -53,7 +53,7 @@ func TestAccAppConfigurationKeysDataSource_label(t *testing.T) { } func (t AppConfigurationKeysDataSource) keys() string { - return fmt.Sprintf(` + return ` resource "azurerm_app_configuration_key" "test" { configuration_store_id = azurerm_app_configuration.test.id key = "key1" @@ -92,7 +92,7 @@ resource "azurerm_app_configuration_key" "test5" { content_type = "test" value = "a test" } -`) +` } func (t AppConfigurationKeysDataSource) allKeys(data acceptance.TestData) string { diff --git a/internal/services/appconfiguration/app_configuration_resource.go b/internal/services/appconfiguration/app_configuration_resource.go index 7277f3ebebc3..485cb02fe4dd 100644 --- a/internal/services/appconfiguration/app_configuration_resource.go +++ b/internal/services/appconfiguration/app_configuration_resource.go @@ -287,11 +287,7 @@ func resourceAppConfigurationCreate(d *pluginsdk.ResourceData, meta interface{}) publicNetworkAccessValue, publicNetworkAccessNotEmpty := d.GetOk("public_network_access") if publicNetworkAccessNotEmpty { - publicNetworkAccess, err := parsePublicNetworkAccess(publicNetworkAccessValue.(string)) - if err != nil { - return fmt.Errorf("unable to parse public_network_access: %+v", err) - } - parameters.Properties.PublicNetworkAccess = publicNetworkAccess + parameters.Properties.PublicNetworkAccess = parsePublicNetworkAccess(publicNetworkAccessValue.(string)) } identity, err := identity.ExpandSystemAndUserAssignedMap(d.Get("identity").([]interface{})) @@ -372,11 +368,7 @@ func resourceAppConfigurationUpdate(d *pluginsdk.ResourceData, meta interface{}) publicNetworkAccessValue, publicNetworkAccessNotEmpty := d.GetOk("public_network_access") if publicNetworkAccessNotEmpty { - publicNetworkAccess, err := parsePublicNetworkAccess(publicNetworkAccessValue.(string)) - if err != nil { - return fmt.Errorf("unable to parse public_network_access: %+v", err) - } - update.Properties.PublicNetworkAccess = publicNetworkAccess + update.Properties.PublicNetworkAccess = parsePublicNetworkAccess(publicNetworkAccessValue.(string)) } } @@ -674,16 +666,16 @@ this into Terraform via "terraform import", or pick a different name/location. `, name, location) } -func parsePublicNetworkAccess(input string) (*configurationstores.PublicNetworkAccess, error) { +func parsePublicNetworkAccess(input string) *configurationstores.PublicNetworkAccess { vals := map[string]configurationstores.PublicNetworkAccess{ "disabled": configurationstores.PublicNetworkAccessDisabled, "enabled": configurationstores.PublicNetworkAccessEnabled, } if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil + return &v } // otherwise presume it's an undefined value and best-effort it out := configurationstores.PublicNetworkAccess(input) - return &out, nil + return &out } diff --git a/internal/services/applicationinsights/application_insights_analytics_item_resource.go b/internal/services/applicationinsights/application_insights_analytics_item_resource.go index 1146d93a9885..b2a91443304b 100644 --- a/internal/services/applicationinsights/application_insights_analytics_item_resource.go +++ b/internal/services/applicationinsights/application_insights_analytics_item_resource.go @@ -5,7 +5,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" + "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/applicationinsights/application_insights_api_key_resource.go b/internal/services/applicationinsights/application_insights_api_key_resource.go index e4411b8dbd49..dc406e111fb2 100644 --- a/internal/services/applicationinsights/application_insights_api_key_resource.go +++ b/internal/services/applicationinsights/application_insights_api_key_resource.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" + "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/applicationinsights/application_insights_resource.go b/internal/services/applicationinsights/application_insights_resource.go index 77daaccdd932..67cd2adda63d 100644 --- a/internal/services/applicationinsights/application_insights_resource.go +++ b/internal/services/applicationinsights/application_insights_resource.go @@ -7,8 +7,8 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" - "github.com/Azure/azure-sdk-for-go/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement" + "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/applicationinsights/application_insights_smart_detection_rule_resource.go b/internal/services/applicationinsights/application_insights_smart_detection_rule_resource.go index cb3a5a70e6e3..a32773f2b2e3 100644 --- a/internal/services/applicationinsights/application_insights_smart_detection_rule_resource.go +++ b/internal/services/applicationinsights/application_insights_smart_detection_rule_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" + "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/applicationinsights/migration" diff --git a/internal/services/applicationinsights/application_insights_webtests_resource.go b/internal/services/applicationinsights/application_insights_webtests_resource.go index ac5b38e8af62..98f9ab15926b 100644 --- a/internal/services/applicationinsights/application_insights_webtests_resource.go +++ b/internal/services/applicationinsights/application_insights_webtests_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" + "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/applicationinsights/application_insights_workbook_resource.go b/internal/services/applicationinsights/application_insights_workbook_resource.go index 51fbb666fc4b..bcea33fdfe48 100644 --- a/internal/services/applicationinsights/application_insights_workbook_resource.go +++ b/internal/services/applicationinsights/application_insights_workbook_resource.go @@ -298,10 +298,7 @@ func (r ApplicationInsightsWorkbookResource) Read() sdk.ResourceFunc { if model.Tags != nil { // The backend returns a tags with key `hidden-title` by default. Since it has the same value with `display_name` and will cause inconsistency with user's configuration, remove it as a workaround. - if _, ok := (*model.Tags)["hidden-title"]; ok { - delete(*model.Tags, "hidden-title") - } - + delete(*model.Tags, "hidden-title") state.Tags = *model.Tags } diff --git a/internal/services/applicationinsights/application_insights_workbook_template_resource.go b/internal/services/applicationinsights/application_insights_workbook_template_resource.go index 881d0254e2cb..520f4b8482fb 100644 --- a/internal/services/applicationinsights/application_insights_workbook_template_resource.go +++ b/internal/services/applicationinsights/application_insights_workbook_template_resource.go @@ -189,11 +189,7 @@ func (r ApplicationInsightsWorkbookTemplateResource) Create() sdk.ResourceFunc { properties.Properties.Localized = &localizedValue } - galleriesValue, err := expandWorkbookTemplateGalleryModel(model.Galleries) - if err != nil { - return err - } - + galleriesValue := expandWorkbookTemplateGalleryModel(model.Galleries) if galleriesValue != nil { properties.Properties.Galleries = *galleriesValue } @@ -239,11 +235,7 @@ func (r ApplicationInsightsWorkbookTemplateResource) Update() sdk.ResourceFunc { } if metadata.ResourceData.HasChange("galleries") { - galleriesValue, err := expandWorkbookTemplateGalleryModel(model.Galleries) - if err != nil { - return err - } - + galleriesValue := expandWorkbookTemplateGalleryModel(model.Galleries) if galleriesValue != nil { properties.Properties.Galleries = *galleriesValue } @@ -321,12 +313,7 @@ func (r ApplicationInsightsWorkbookTemplateResource) Read() sdk.ResourceFunc { state.Author = *properties.Author } - galleriesValue, err := flattenWorkbookTemplateGalleryModel(&properties.Galleries) - if err != nil { - return err - } - - state.Galleries = galleriesValue + state.Galleries = flattenWorkbookTemplateGalleryModel(&properties.Galleries) if properties.Priority != nil { state.Priority = *properties.Priority @@ -380,7 +367,7 @@ func (r ApplicationInsightsWorkbookTemplateResource) Delete() sdk.ResourceFunc { } } -func expandWorkbookTemplateGalleryModel(inputList []WorkbookTemplateGalleryModel) (*[]workbooktemplates.WorkbookTemplateGallery, error) { +func expandWorkbookTemplateGalleryModel(inputList []WorkbookTemplateGalleryModel) *[]workbooktemplates.WorkbookTemplateGallery { var outputList []workbooktemplates.WorkbookTemplateGallery for _, input := range inputList { output := workbooktemplates.WorkbookTemplateGallery{ @@ -394,13 +381,13 @@ func expandWorkbookTemplateGalleryModel(inputList []WorkbookTemplateGalleryModel outputList = append(outputList, output) } - return &outputList, nil + return &outputList } -func flattenWorkbookTemplateGalleryModel(inputList *[]workbooktemplates.WorkbookTemplateGallery) ([]WorkbookTemplateGalleryModel, error) { +func flattenWorkbookTemplateGalleryModel(inputList *[]workbooktemplates.WorkbookTemplateGallery) []WorkbookTemplateGalleryModel { var outputList []WorkbookTemplateGalleryModel if inputList == nil { - return outputList, nil + return outputList } for _, input := range *inputList { @@ -429,5 +416,5 @@ func flattenWorkbookTemplateGalleryModel(inputList *[]workbooktemplates.Workbook outputList = append(outputList, output) } - return outputList, nil + return outputList } diff --git a/internal/services/applicationinsights/azuresdkhacks/webtests.go b/internal/services/applicationinsights/azuresdkhacks/webtests.go index 76ae70e05907..dd5310afd358 100644 --- a/internal/services/applicationinsights/azuresdkhacks/webtests.go +++ b/internal/services/applicationinsights/azuresdkhacks/webtests.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" + "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" // nolint: staticcheck "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/services/applicationinsights/parse" diff --git a/internal/services/applicationinsights/client/client.go b/internal/services/applicationinsights/client/client.go index 0746f0d7e629..f9affc88fd0e 100644 --- a/internal/services/applicationinsights/client/client.go +++ b/internal/services/applicationinsights/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" + "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" // nolint: staticcheck workbooktemplates "github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis" workbooks "github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis" "github.com/hashicorp/terraform-provider-azurerm/internal/common" diff --git a/internal/services/appservice/client/client.go b/internal/services/appservice/client/client.go index a71a21626678..042cae861682 100644 --- a/internal/services/appservice/client/client.go +++ b/internal/services/appservice/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/appservice/function_app_active_slot_resource.go b/internal/services/appservice/function_app_active_slot_resource.go index d2a5254b28cb..5fb41759689c 100644 --- a/internal/services/appservice/function_app_active_slot_resource.go +++ b/internal/services/appservice/function_app_active_slot_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/parse" diff --git a/internal/services/appservice/function_app_function_resource.go b/internal/services/appservice/function_app_function_resource.go index 8aeec1c4fca5..448912d93d77 100644 --- a/internal/services/appservice/function_app_function_resource.go +++ b/internal/services/appservice/function_app_function_resource.go @@ -6,7 +6,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/parse" diff --git a/internal/services/appservice/function_app_hybrid_connection_resource.go b/internal/services/appservice/function_app_hybrid_connection_resource.go index 356456b9fd74..e7b4c957e830 100644 --- a/internal/services/appservice/function_app_hybrid_connection_resource.go +++ b/internal/services/appservice/function_app_hybrid_connection_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-sdk/resource-manager/relay/2017-04-01/hybridconnections" "github.com/hashicorp/go-azure-sdk/resource-manager/relay/2017-04-01/namespaces" diff --git a/internal/services/appservice/helpers/function_app_schema.go b/internal/services/appservice/helpers/function_app_schema.go index d4755fbb9e3d..072278a04611 100644 --- a/internal/services/appservice/helpers/function_app_schema.go +++ b/internal/services/appservice/helpers/function_app_schema.go @@ -5,7 +5,7 @@ import ( "strconv" "strings" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" apimValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/validate" diff --git a/internal/services/appservice/helpers/function_app_schema_test.go b/internal/services/appservice/helpers/function_app_schema_test.go index 74650baaf155..bfdbd8e3b4cb 100644 --- a/internal/services/appservice/helpers/function_app_schema_test.go +++ b/internal/services/appservice/helpers/function_app_schema_test.go @@ -5,7 +5,7 @@ import ( "sort" "testing" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/helpers" "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/appservice/helpers/function_app_slot_schema.go b/internal/services/appservice/helpers/function_app_slot_schema.go index 6a429acfc962..41a16ec0e451 100644 --- a/internal/services/appservice/helpers/function_app_slot_schema.go +++ b/internal/services/appservice/helpers/function_app_slot_schema.go @@ -5,7 +5,7 @@ import ( "strconv" "strings" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" apimValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/appservice/helpers/publish_app.go b/internal/services/appservice/helpers/publish_app.go index 6c8777b5831b..9f2e4ecd7e72 100644 --- a/internal/services/appservice/helpers/publish_app.go +++ b/internal/services/appservice/helpers/publish_app.go @@ -9,7 +9,7 @@ import ( "os" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" ) diff --git a/internal/services/appservice/helpers/shared_schema.go b/internal/services/appservice/helpers/shared_schema.go index d37d655d3473..9aeda6a69c89 100644 --- a/internal/services/appservice/helpers/shared_schema.go +++ b/internal/services/appservice/helpers/shared_schema.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/validate" networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/appservice/helpers/web_app_schema.go b/internal/services/appservice/helpers/web_app_schema.go index ad5c8da44ee8..1ddc1aff4c29 100644 --- a/internal/services/appservice/helpers/web_app_schema.go +++ b/internal/services/appservice/helpers/web_app_schema.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" @@ -2892,10 +2892,10 @@ func ExpandSiteConfigWindows(siteConfig []SiteConfigWindows, existing *web.SiteC if servicePlan.Sku != nil && servicePlan.Sku.Name != nil { if isFreeOrSharedServicePlan(*servicePlan.Sku.Name) { - if winSiteConfig.AlwaysOn == true { + if winSiteConfig.AlwaysOn { return nil, nil, fmt.Errorf("always_on cannot be set to true when using Free, F1, D1 Sku") } - if expanded.AlwaysOn != nil && *expanded.AlwaysOn == true { + if expanded.AlwaysOn != nil && *expanded.AlwaysOn { return nil, nil, fmt.Errorf("always_on feature has to be turned off before switching to a free/shared Sku") } } @@ -3058,10 +3058,10 @@ func ExpandSiteConfigLinux(siteConfig []SiteConfigLinux, existing *web.SiteConfi if servicePlan.Sku != nil && servicePlan.Sku.Name != nil { if isFreeOrSharedServicePlan(*servicePlan.Sku.Name) { - if linuxSiteConfig.AlwaysOn == true { + if linuxSiteConfig.AlwaysOn { return nil, fmt.Errorf("always_on cannot be set to true when using Free, F1, D1 Sku") } - if expanded.AlwaysOn != nil && *expanded.AlwaysOn == true { + if expanded.AlwaysOn != nil && *expanded.AlwaysOn { return nil, fmt.Errorf("always_on feature has to be turned off before switching to a free/shared Sku") } } diff --git a/internal/services/appservice/helpers/web_app_slot_schema.go b/internal/services/appservice/helpers/web_app_slot_schema.go index 4e423f570fe6..0ebcc52ab57f 100644 --- a/internal/services/appservice/helpers/web_app_slot_schema.go +++ b/internal/services/appservice/helpers/web_app_slot_schema.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" apimValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/appservice/identity.go b/internal/services/appservice/identity.go index fd2e434e853b..f1bbadb8ca11 100644 --- a/internal/services/appservice/identity.go +++ b/internal/services/appservice/identity.go @@ -1,7 +1,7 @@ package appservice import ( - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" ) diff --git a/internal/services/appservice/linux_function_app_data_source.go b/internal/services/appservice/linux_function_app_data_source.go index 4faa0e0ec231..f05502152a45 100644 --- a/internal/services/appservice/linux_function_app_data_source.go +++ b/internal/services/appservice/linux_function_app_data_source.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" diff --git a/internal/services/appservice/linux_function_app_resource.go b/internal/services/appservice/linux_function_app_resource.go index 04df7b27ad42..39ac6c7dbc82 100644 --- a/internal/services/appservice/linux_function_app_resource.go +++ b/internal/services/appservice/linux_function_app_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/google/uuid" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" diff --git a/internal/services/appservice/linux_function_app_slot_resource.go b/internal/services/appservice/linux_function_app_slot_resource.go index e507aebd8e84..7c72821b89ab 100644 --- a/internal/services/appservice/linux_function_app_slot_resource.go +++ b/internal/services/appservice/linux_function_app_slot_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/google/uuid" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" diff --git a/internal/services/appservice/linux_function_app_slot_resource_test.go b/internal/services/appservice/linux_function_app_slot_resource_test.go index 3ac67786e851..df7329ef8893 100644 --- a/internal/services/appservice/linux_function_app_slot_resource_test.go +++ b/internal/services/appservice/linux_function_app_slot_resource_test.go @@ -1621,6 +1621,7 @@ resource "azurerm_linux_function_app_slot" "test" { `, r.template(data, planSku), data.RandomInteger, javaVersion) } +// nolint: unparam func (r LinuxFunctionAppSlotResource) appStackNode(data acceptance.TestData, planSku string, nodeVersion string) string { return fmt.Sprintf(` provider "azurerm" { diff --git a/internal/services/appservice/linux_web_app_resource.go b/internal/services/appservice/linux_web_app_resource.go index 74a4a762bd52..04c1c653a9e8 100644 --- a/internal/services/appservice/linux_web_app_resource.go +++ b/internal/services/appservice/linux_web_app_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" @@ -787,7 +787,7 @@ func (r LinuxWebAppResource) Update() sdk.ResourceFunc { } } - if metadata.ResourceData.HasChange("zip_deploy_file") || metadata.ResourceData.HasChange("zip_deploy_file") { + if metadata.ResourceData.HasChange("zip_deploy_file") { if err = helpers.GetCredentialsAndPublish(ctx, client, id.ResourceGroup, id.SiteName, state.ZipDeployFile); err != nil { return err } diff --git a/internal/services/appservice/linux_web_app_slot_resource.go b/internal/services/appservice/linux_web_app_slot_resource.go index c06a7d4351e2..897fb30613a1 100644 --- a/internal/services/appservice/linux_web_app_slot_resource.go +++ b/internal/services/appservice/linux_web_app_slot_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" @@ -687,7 +687,7 @@ func (r LinuxWebAppSlotResource) Update() sdk.ResourceFunc { } } - if metadata.ResourceData.HasChange("zip_deploy_file") || metadata.ResourceData.HasChange("zip_deploy_file") { + if metadata.ResourceData.HasChange("zip_deploy_file") { if err = helpers.GetCredentialsAndPublishSlot(ctx, client, id.ResourceGroup, id.SiteName, state.ZipDeployFile, id.SlotName); err != nil { return err } diff --git a/internal/services/appservice/service_plan_resource.go b/internal/services/appservice/service_plan_resource.go index 44db8a01adbe..d2a722f837d0 100644 --- a/internal/services/appservice/service_plan_resource.go +++ b/internal/services/appservice/service_plan_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" diff --git a/internal/services/appservice/source_control_resource.go b/internal/services/appservice/source_control_resource.go index 20c2b58d9241..ab8b2bc00b47 100644 --- a/internal/services/appservice/source_control_resource.go +++ b/internal/services/appservice/source_control_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/validate" diff --git a/internal/services/appservice/source_control_schema.go b/internal/services/appservice/source_control_schema.go index 3e739ce2fe25..20c5c9649943 100644 --- a/internal/services/appservice/source_control_schema.go +++ b/internal/services/appservice/source_control_schema.go @@ -1,7 +1,7 @@ package appservice import ( - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/appservice/source_control_slot_resource.go b/internal/services/appservice/source_control_slot_resource.go index f2eecc4bc638..d4dc84e0248e 100644 --- a/internal/services/appservice/source_control_slot_resource.go +++ b/internal/services/appservice/source_control_slot_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/parse" diff --git a/internal/services/appservice/source_control_token_resource.go b/internal/services/appservice/source_control_token_resource.go index 33479521167c..b74ddd96d98b 100644 --- a/internal/services/appservice/source_control_token_resource.go +++ b/internal/services/appservice/source_control_token_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/validate" diff --git a/internal/services/appservice/web_app_active_slot_resource.go b/internal/services/appservice/web_app_active_slot_resource.go index 7cd5e09f269f..65a6d4a29f88 100644 --- a/internal/services/appservice/web_app_active_slot_resource.go +++ b/internal/services/appservice/web_app_active_slot_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/parse" diff --git a/internal/services/appservice/web_app_hybrid_connection_resource.go b/internal/services/appservice/web_app_hybrid_connection_resource.go index b3800e2a0b06..f01b63fdea29 100644 --- a/internal/services/appservice/web_app_hybrid_connection_resource.go +++ b/internal/services/appservice/web_app_hybrid_connection_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-sdk/resource-manager/relay/2017-04-01/hybridconnections" "github.com/hashicorp/go-azure-sdk/resource-manager/relay/2017-04-01/namespaces" diff --git a/internal/services/appservice/windows_function_app_data_source.go b/internal/services/appservice/windows_function_app_data_source.go index 1f3e5e971d2d..5cf2e0c42cac 100644 --- a/internal/services/appservice/windows_function_app_data_source.go +++ b/internal/services/appservice/windows_function_app_data_source.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" diff --git a/internal/services/appservice/windows_function_app_resource.go b/internal/services/appservice/windows_function_app_resource.go index 7a15f2c3f5b1..780b39400977 100644 --- a/internal/services/appservice/windows_function_app_resource.go +++ b/internal/services/appservice/windows_function_app_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/google/uuid" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" diff --git a/internal/services/appservice/windows_function_app_slot_resource.go b/internal/services/appservice/windows_function_app_slot_resource.go index ebac9b56bd4d..1da0dc327001 100644 --- a/internal/services/appservice/windows_function_app_slot_resource.go +++ b/internal/services/appservice/windows_function_app_slot_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/google/uuid" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" diff --git a/internal/services/appservice/windows_web_app_resource.go b/internal/services/appservice/windows_web_app_resource.go index d8f397f9f1cf..c128e3e5e50e 100644 --- a/internal/services/appservice/windows_web_app_resource.go +++ b/internal/services/appservice/windows_web_app_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" @@ -807,7 +807,7 @@ func (r WindowsWebAppResource) Update() sdk.ResourceFunc { } } - if metadata.ResourceData.HasChange("zip_deploy_file") || metadata.ResourceData.HasChange("zip_deploy_file") { + if metadata.ResourceData.HasChange("zip_deploy_file") { if err = helpers.GetCredentialsAndPublish(ctx, client, id.ResourceGroup, id.SiteName, state.ZipDeployFile); err != nil { return err } diff --git a/internal/services/appservice/windows_web_app_resource_test.go b/internal/services/appservice/windows_web_app_resource_test.go index a8bf84565418..eb130e37bfb9 100644 --- a/internal/services/appservice/windows_web_app_resource_test.go +++ b/internal/services/appservice/windows_web_app_resource_test.go @@ -2246,6 +2246,7 @@ resource "azurerm_windows_web_app" "test" { `, r.baseTemplate(data), data.RandomInteger, pythonVersion) } +//nolint:unparam func (r WindowsWebAppResource) java(data acceptance.TestData, javaVersion string, javaContainer string, javaContainerVersion string) string { javaContainerStr := "" if javaContainer != "" { diff --git a/internal/services/appservice/windows_web_app_slot_resource.go b/internal/services/appservice/windows_web_app_slot_resource.go index 787955b29300..7312edef7ab4 100644 --- a/internal/services/appservice/windows_web_app_slot_resource.go +++ b/internal/services/appservice/windows_web_app_slot_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" @@ -696,7 +696,7 @@ func (r WindowsWebAppSlotResource) Update() sdk.ResourceFunc { } } - if metadata.ResourceData.HasChange("zip_deploy_file") || metadata.ResourceData.HasChange("zip_deploy_file") { + if metadata.ResourceData.HasChange("zip_deploy_file") { if err = helpers.GetCredentialsAndPublishSlot(ctx, client, id.ResourceGroup, id.SiteName, state.ZipDeployFile, id.SlotName); err != nil { return err } diff --git a/internal/services/authorization/azuresdkhacks/definitions.go b/internal/services/authorization/azuresdkhacks/definitions.go index 1f9a60526a50..93fa65c4dc28 100644 --- a/internal/services/authorization/azuresdkhacks/definitions.go +++ b/internal/services/authorization/azuresdkhacks/definitions.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2020-04-01-preview/authorization" + "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2020-04-01-preview/authorization" // nolint: staticcheck "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" ) diff --git a/internal/services/authorization/client/client.go b/internal/services/authorization/client/client.go index d79a77bf94a4..2da83c9530f7 100644 --- a/internal/services/authorization/client/client.go +++ b/internal/services/authorization/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2020-04-01-preview/authorization" + "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2020-04-01-preview/authorization" // nolint: staticcheck // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/authorization/role_assignment_resource.go b/internal/services/authorization/role_assignment_resource.go index 6817baf928c2..8a8bd491112d 100644 --- a/internal/services/authorization/role_assignment_resource.go +++ b/internal/services/authorization/role_assignment_resource.go @@ -7,8 +7,8 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2020-04-01-preview/authorization" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2021-01-01/subscriptions" + "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2020-04-01-preview/authorization" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2021-01-01/subscriptions" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/authorization/role_assignment_resource_test.go b/internal/services/authorization/role_assignment_resource_test.go index d17cfabaf06d..6ab149a33ca1 100644 --- a/internal/services/authorization/role_assignment_resource_test.go +++ b/internal/services/authorization/role_assignment_resource_test.go @@ -565,6 +565,7 @@ resource "azurerm_role_assignment" "test" { `, groupId) } +// nolint: unused func (RoleAssignmentResource) subscriptionScoped(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { diff --git a/internal/services/authorization/role_definition_data_source.go b/internal/services/authorization/role_definition_data_source.go index 82928ac0a5be..15c348e6de62 100644 --- a/internal/services/authorization/role_definition_data_source.go +++ b/internal/services/authorization/role_definition_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2020-04-01-preview/authorization" + "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2020-04-01-preview/authorization" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" diff --git a/internal/services/authorization/role_definition_resource.go b/internal/services/authorization/role_definition_resource.go index e832bbca6b8b..07a5b6b4c2f9 100644 --- a/internal/services/authorization/role_definition_resource.go +++ b/internal/services/authorization/role_definition_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2020-04-01-preview/authorization" + "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2020-04-01-preview/authorization" // nolint: staticcheck "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -66,7 +66,7 @@ func resourceArmRoleDefinition() *pluginsdk.Resource { Optional: true, }, - //lintignore:XS003 + // lintignore:XS003 "permissions": { Type: pluginsdk.TypeList, Optional: true, diff --git a/internal/services/automation/automation_account_resource.go b/internal/services/automation/automation_account_resource.go index ee764dfc0fba..701899ec6ca2 100644 --- a/internal/services/automation/automation_account_resource.go +++ b/internal/services/automation/automation_account_resource.go @@ -182,7 +182,7 @@ func resourceAutomationAccountCreate(d *pluginsdk.ResourceData, meta interface{} Location: utils.String(location.Normalize(d.Get("location").(string))), } - if localAuth := d.Get("local_authentication_enabled").(bool); localAuth == false { + if localAuth := d.Get("local_authentication_enabled").(bool); !localAuth { parameters.Properties.DisableLocalAuth = utils.Bool(true) } if encryption := d.Get("encryption").([]interface{}); len(encryption) > 0 { @@ -232,7 +232,7 @@ func resourceAutomationAccountUpdate(d *pluginsdk.ResourceData, meta interface{} Identity: identity, } - if localAuth := d.Get("local_authentication_enabled").(bool); localAuth == false { + if localAuth := d.Get("local_authentication_enabled").(bool); !localAuth { parameters.Properties.DisableLocalAuth = utils.Bool(true) } @@ -308,7 +308,7 @@ func resourceAutomationAccountRead(d *pluginsdk.ResourceData, meta interface{}) d.Set("sku_name", skuName) localAuthEnabled := true - if val := prop.DisableLocalAuth; val != nil && *val == true { + if val := prop.DisableLocalAuth; val != nil && *val { localAuthEnabled = false } d.Set("local_authentication_enabled", localAuthEnabled) diff --git a/internal/services/automation/automation_certificate_resource.go b/internal/services/automation/automation_certificate_resource.go index 1914c7e1f3c5..64d6a7db72d2 100644 --- a/internal/services/automation/automation_certificate_resource.go +++ b/internal/services/automation/automation_certificate_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/automation/automation_connection_certificate_resource.go b/internal/services/automation/automation_connection_certificate_resource.go index 5ace12d25f09..30dcef8132fb 100644 --- a/internal/services/automation/automation_connection_certificate_resource.go +++ b/internal/services/automation/automation_connection_certificate_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/automation/automation_connection_classic_certificate_resource.go b/internal/services/automation/automation_connection_classic_certificate_resource.go index b5cb0b7aedb3..598e49e64956 100644 --- a/internal/services/automation/automation_connection_classic_certificate_resource.go +++ b/internal/services/automation/automation_connection_classic_certificate_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/automation/automation_connection_resource.go b/internal/services/automation/automation_connection_resource.go index 7c954a2c7755..573448ca28cd 100644 --- a/internal/services/automation/automation_connection_resource.go +++ b/internal/services/automation/automation_connection_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/automation/automation_connection_service_principal_resource.go b/internal/services/automation/automation_connection_service_principal_resource.go index e81e71c0b19c..3eb9c186db15 100644 --- a/internal/services/automation/automation_connection_service_principal_resource.go +++ b/internal/services/automation/automation_connection_service_principal_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/automation/automation_connection_type_resource.go b/internal/services/automation/automation_connection_type_resource.go index 5db52899c5a7..8bf1b390f014 100644 --- a/internal/services/automation/automation_connection_type_resource.go +++ b/internal/services/automation/automation_connection_type_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/automationaccount" diff --git a/internal/services/automation/automation_credential_resource.go b/internal/services/automation/automation_credential_resource.go index 9fdc0272d313..481d8c08c825 100644 --- a/internal/services/automation/automation_credential_resource.go +++ b/internal/services/automation/automation_credential_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/automation/automation_dsc_configuration_resource.go b/internal/services/automation/automation_dsc_configuration_resource.go index b10250cf6cfb..4f767fb07554 100644 --- a/internal/services/automation/automation_dsc_configuration_resource.go +++ b/internal/services/automation/automation_dsc_configuration_resource.go @@ -7,7 +7,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/automation/automation_dsc_nodeconfiguration_resource.go b/internal/services/automation/automation_dsc_nodeconfiguration_resource.go index 1235a5d67ad8..17efbef1f21a 100644 --- a/internal/services/automation/automation_dsc_nodeconfiguration_resource.go +++ b/internal/services/automation/automation_dsc_nodeconfiguration_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/automation/automation_job_schedule_resource.go b/internal/services/automation/automation_job_schedule_resource.go index 74e0053e3be2..3b9dd6979750 100644 --- a/internal/services/automation/automation_job_schedule_resource.go +++ b/internal/services/automation/automation_job_schedule_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/gofrs/uuid" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/automation/automation_module_resource.go b/internal/services/automation/automation_module_resource.go index 8a5ff97a95af..6d5eeb1b5c5e 100644 --- a/internal/services/automation/automation_module_resource.go +++ b/internal/services/automation/automation_module_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -106,9 +106,7 @@ func resourceAutomationModuleCreateUpdate(d *pluginsdk.ResourceData, meta interf } // for existing global module do update instead of raising ImportAsExistsError - isGlobal := existing.ModuleProperties != nil && - existing.ModuleProperties.IsGlobal != nil && - *existing.ModuleProperties.IsGlobal == true + isGlobal := existing.ModuleProperties != nil && existing.ModuleProperties.IsGlobal != nil && *existing.ModuleProperties.IsGlobal if !utils.ResponseWasNotFound(existing.Response) && !isGlobal { return tf.ImportAsExistsError("azurerm_automation_module", id.ID()) } diff --git a/internal/services/automation/automation_runbook_resource.go b/internal/services/automation/automation_runbook_resource.go index 2ed0c15fe5da..8378d2999c51 100644 --- a/internal/services/automation/automation_runbook_resource.go +++ b/internal/services/automation/automation_runbook_resource.go @@ -7,7 +7,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/gofrs/uuid" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" diff --git a/internal/services/automation/automation_schedule_resource.go b/internal/services/automation/automation_schedule_resource.go index 058fc969b042..c515a464a3fd 100644 --- a/internal/services/automation/automation_schedule_resource.go +++ b/internal/services/automation/automation_schedule_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/automation/automation_software_update_configuration.go b/internal/services/automation/automation_software_update_configuration.go index 8a3339adf984..ddf74079fbd2 100644 --- a/internal/services/automation/automation_software_update_configuration.go +++ b/internal/services/automation/automation_software_update_configuration.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" @@ -42,9 +42,7 @@ func (a *AzureQuery) LoadSDKTags(tags map[string][]string) { for k, vs := range tags { t := Tag{} t.Tag = k - for _, v := range vs { - t.Values = append(t.Values, v) - } + t.Values = append(t.Values, vs...) a.Tags = append(a.Tags, t) } } diff --git a/internal/services/automation/automation_source_control.go b/internal/services/automation/automation_source_control.go index 2eb3d517b07f..d71674922aea 100644 --- a/internal/services/automation/automation_source_control.go +++ b/internal/services/automation/automation_source_control.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/automation/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/automation/validate" diff --git a/internal/services/automation/automation_variable.go b/internal/services/automation/automation_variable.go index 9be981ea8cd2..de1353123524 100644 --- a/internal/services/automation/automation_variable.go +++ b/internal/services/automation/automation_variable.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/automation/automation_variable_test.go b/internal/services/automation/automation_variable_test.go index f88b3cec9762..5caee2d537af 100644 --- a/internal/services/automation/automation_variable_test.go +++ b/internal/services/automation/automation_variable_test.go @@ -70,7 +70,7 @@ func TestParseAzureRmAutomationVariableValue(t *testing.T) { Value: "true", HasError: false, ExpectValue: true, - Expect: func(v interface{}) bool { return v.(bool) == true }, + Expect: func(v interface{}) bool { return v.(bool) }, }, { Name: "boolean variable false", @@ -78,7 +78,7 @@ func TestParseAzureRmAutomationVariableValue(t *testing.T) { Value: "false", HasError: false, ExpectValue: false, - Expect: func(v interface{}) bool { return v.(bool) == false }, + Expect: func(v interface{}) bool { return !v.(bool) }, }, { Name: "datetime variable", diff --git a/internal/services/automation/automation_watcher.go b/internal/services/automation/automation_watcher.go index cd9191e6aa95..49d41bc84791 100644 --- a/internal/services/automation/automation_watcher.go +++ b/internal/services/automation/automation_watcher.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/automation/parse" diff --git a/internal/services/automation/automation_webhook.go b/internal/services/automation/automation_webhook.go index cdfc7fa70cd5..6e56bb076db4 100644 --- a/internal/services/automation/automation_webhook.go +++ b/internal/services/automation/automation_webhook.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/internal/services/automation/client/client.go b/internal/services/automation/client/client.go index f6c68ab66f60..9389c752f12d 100644 --- a/internal/services/automation/client/client.go +++ b/internal/services/automation/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook" "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/automationaccount" "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworker" diff --git a/internal/services/automation/helper/automation_job_schedule.go b/internal/services/automation/helper/automation_job_schedule.go index 63a275ea0917..fea58c8d096c 100644 --- a/internal/services/automation/helper/automation_job_schedule.go +++ b/internal/services/automation/helper/automation_job_schedule.go @@ -4,7 +4,7 @@ import ( "bytes" "fmt" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/gofrs/uuid" "github.com/hashicorp/terraform-provider-azurerm/internal/services/automation/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/batch/batch_account.go b/internal/services/batch/batch_account.go index fa2c4bf438c3..2192be3a128f 100644 --- a/internal/services/batch/batch_account.go +++ b/internal/services/batch/batch_account.go @@ -3,7 +3,7 @@ package batch import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" // nolint: staticcheck ) // expandBatchAccountKeyVaultReference expands Batch account KeyVault reference diff --git a/internal/services/batch/batch_account_data_source.go b/internal/services/batch/batch_account_data_source.go index 825c26057bb5..aa1a7e8da469 100644 --- a/internal/services/batch/batch_account_data_source.go +++ b/internal/services/batch/batch_account_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/batch/batch_account_resource.go b/internal/services/batch/batch_account_resource.go index 1475a36a30f0..cd732b7a038e 100644 --- a/internal/services/batch/batch_account_resource.go +++ b/internal/services/batch/batch_account_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" diff --git a/internal/services/batch/batch_application_resource.go b/internal/services/batch/batch_application_resource.go index 9741a8f2c81a..20d67d7a446d 100644 --- a/internal/services/batch/batch_application_resource.go +++ b/internal/services/batch/batch_application_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/batch/batch_certificate_resource.go b/internal/services/batch/batch_certificate_resource.go index 8bacd6f201e4..6fe8fb35f495 100644 --- a/internal/services/batch/batch_certificate_resource.go +++ b/internal/services/batch/batch_certificate_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/batch/batch_pool.go b/internal/services/batch/batch_pool.go index 96b16e1e8623..1328507cda03 100644 --- a/internal/services/batch/batch_pool.go +++ b/internal/services/batch/batch_pool.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" @@ -490,7 +490,7 @@ func ExpandBatchPoolImageReference(list []interface{}) (*batch.ImageReference, e // ExpandBatchPoolContainerConfiguration expands the Batch pool container configuration func ExpandBatchPoolContainerConfiguration(list []interface{}) (*batch.ContainerConfiguration, error) { - if len(list) == 0 || list[0] == nil { + if len(list) == 0 { return nil, nil } @@ -796,7 +796,7 @@ func expandBatchPoolOSDisk(ref interface{}) (*batch.OSDisk, error) { } func expandBatchPoolNodeReplacementConfig(list []interface{}) (*batch.NodePlacementConfiguration, error) { - if list == nil || len(list) == 0 || list[0] == nil { + if len(list) == 0 { return nil, fmt.Errorf("node_placement is empty") } item := list[0].(map[string]interface{})["policy"].(string) @@ -806,7 +806,7 @@ func expandBatchPoolNodeReplacementConfig(list []interface{}) (*batch.NodePlacem } func expandBatchPoolWindowsConfiguration(list []interface{}) (*batch.WindowsConfiguration, error) { - if list == nil || len(list) == 0 || list[0] == nil { + if len(list) == 0 { return nil, fmt.Errorf("windows is empty") } @@ -817,7 +817,7 @@ func expandBatchPoolWindowsConfiguration(list []interface{}) (*batch.WindowsConf } func expandBatchPoolExtensions(list []interface{}) (*[]batch.VMExtension, error) { - if list == nil || len(list) == 0 || list[0] == nil { + if len(list) == 0 { return nil, fmt.Errorf("extensions is empty") } @@ -836,7 +836,7 @@ func expandBatchPoolExtensions(list []interface{}) (*[]batch.VMExtension, error) } func expandBatchPoolExtension(ref map[string]interface{}) (*batch.VMExtension, error) { - if ref == nil || len(ref) == 0 { + if len(ref) == 0 { return nil, fmt.Errorf("extension is empty") } @@ -870,7 +870,7 @@ func expandBatchPoolExtension(ref map[string]interface{}) (*batch.VMExtension, e } func expandBatchPoolDiskEncryptionConfiguration(list []interface{}) (*batch.DiskEncryptionConfiguration, error) { - if list == nil || len(list) == 0 || list[0] == nil { + if len(list) == 0 { return nil, fmt.Errorf("disk_encryption is empty") } var result batch.DiskEncryptionConfiguration @@ -891,30 +891,26 @@ func expandBatchPoolDiskEncryptionConfiguration(list []interface{}) (*batch.Disk } func expandBatchPoolDataDisks(list []interface{}) (*[]batch.DataDisk, error) { - if list == nil || len(list) == 0 || list[0] == nil { + if len(list) == 0 { return nil, fmt.Errorf("data_disk is empty") } var result []batch.DataDisk for _, tempItem := range list { item := tempItem.(map[string]interface{}) - dataDisk, err := expandBatchPoolDataDisk(item) - if err != nil { - return nil, err - } - result = append(result, *dataDisk) + result = append(result, expandBatchPoolDataDisk(item)) } return &result, nil } -func expandBatchPoolDataDisk(ref map[string]interface{}) (*batch.DataDisk, error) { - return &batch.DataDisk{ +func expandBatchPoolDataDisk(ref map[string]interface{}) batch.DataDisk { + return batch.DataDisk{ Lun: utils.Int32(int32(ref["lun"].(int))), Caching: batch.CachingType(ref["caching"].(string)), DiskSizeGB: utils.Int32(int32(ref["disk_size_gb"].(int))), StorageAccountType: batch.StorageAccountType(ref["storage_account_type"].(string)), - }, nil + } } func expandCommonEnvironmentProperties(env map[string]interface{}) *[]batch.EnvironmentSetting { @@ -975,9 +971,7 @@ func ExpandBatchPoolMountConfigurations(d *pluginsdk.ResourceData) (*[]batch.Mou mountConfigList := mountConfigs.([]interface{}) for _, tempItem := range mountConfigList { item := tempItem.(map[string]interface{}) - if mountConfig, err := expandBatchPoolMountConfiguration(item); err == nil { - result = append(result, mountConfig) - } + result = append(result, expandBatchPoolMountConfiguration(item)) } return &result, nil } @@ -985,7 +979,7 @@ func ExpandBatchPoolMountConfigurations(d *pluginsdk.ResourceData) (*[]batch.Mou return nil, fmt.Errorf("mount either is empty or contains parsing errors") } -func expandBatchPoolMountConfiguration(ref map[string]interface{}) (batch.MountConfiguration, error) { +func expandBatchPoolMountConfiguration(ref map[string]interface{}) batch.MountConfiguration { var result batch.MountConfiguration if azureBlobFileSystemConfiguration, err := expandBatchPoolAzureBlobFileSystemConfiguration(ref["azure_blob_file_system"].([]interface{})); err == nil { result.AzureBlobFileSystemConfiguration = azureBlobFileSystemConfiguration @@ -1003,11 +997,11 @@ func expandBatchPoolMountConfiguration(ref map[string]interface{}) (batch.MountC result.NfsMountConfiguration = nfsMountConfiguration } - return result, nil + return result } func expandBatchPoolAzureBlobFileSystemConfiguration(list []interface{}) (*batch.AzureBlobFileSystemConfiguration, interface{}) { - if list == nil || len(list) == 0 || list[0] == nil { + if len(list) == 0 { return nil, fmt.Errorf("azure_blob_file_system is empty") } @@ -1033,7 +1027,7 @@ func expandBatchPoolAzureBlobFileSystemConfiguration(list []interface{}) (*batch } func expandBatchPoolAzureFileShareConfiguration(list []interface{}) (*batch.AzureFileShareConfiguration, interface{}) { - if list == nil || len(list) == 0 || list[0] == nil { + if len(list) == 0 { return nil, fmt.Errorf("azure_file_share is empty") } @@ -1053,7 +1047,7 @@ func expandBatchPoolAzureFileShareConfiguration(list []interface{}) (*batch.Azur } func expandBatchPoolCIFSMountConfiguration(list []interface{}) (*batch.CIFSMountConfiguration, interface{}) { - if list == nil || len(list) == 0 || list[0] == nil { + if len(list) == 0 { return nil, fmt.Errorf("cifs_mount is empty") } @@ -1073,7 +1067,7 @@ func expandBatchPoolCIFSMountConfiguration(list []interface{}) (*batch.CIFSMount } func expandBatchPoolNFSMountConfiguration(list []interface{}) (*batch.NFSMountConfiguration, interface{}) { - if list == nil || len(list) == 0 || list[0] == nil { + if len(list) == 0 { return nil, fmt.Errorf("nfs_mount is empty") } @@ -1152,7 +1146,7 @@ func ExpandBatchPoolTaskSchedulingPolicy(d *pluginsdk.ResourceData) (*batch.Task if taskSchedulingPolicyString, ok := d.GetOk("task_scheduling_policy"); ok { taskSchedulingPolicy := taskSchedulingPolicyString.([]interface{}) - if taskSchedulingPolicy != nil && len(taskSchedulingPolicy) > 0 { + if len(taskSchedulingPolicy) > 0 { item := taskSchedulingPolicy[0].(map[string]interface{}) result.NodeFillType = batch.ComputeNodeFillType(item["node_fill_type"].(string)) } @@ -1330,9 +1324,7 @@ func ExpandBatchPoolUserAccounts(d *pluginsdk.ResourceData) (*[]batch.UserAccoun if len(userAccounts) > 0 && userAccounts[0] != nil { for _, tempItem := range userAccounts { item := tempItem.(map[string]interface{}) - if userAccount, err := expandBatchPoolUserAccount(item); err == nil { - result = append(result, userAccount) - } + result = append(result, expandBatchPoolUserAccount(item)) } return &result, nil } @@ -1341,7 +1333,7 @@ func ExpandBatchPoolUserAccounts(d *pluginsdk.ResourceData) (*[]batch.UserAccoun return nil, fmt.Errorf("user_accounts either is empty or contains parsing errors") } -func expandBatchPoolUserAccount(ref map[string]interface{}) (batch.UserAccount, error) { +func expandBatchPoolUserAccount(ref map[string]interface{}) batch.UserAccount { result := batch.UserAccount{ Name: utils.String(ref["name"].(string)), Password: utils.String(ref["password"].(string)), @@ -1374,5 +1366,5 @@ func expandBatchPoolUserAccount(ref map[string]interface{}) (batch.UserAccount, } } - return result, nil + return result } diff --git a/internal/services/batch/batch_pool_resource.go b/internal/services/batch/batch_pool_resource.go index 0136f3bc02b3..2126c4568078 100644 --- a/internal/services/batch/batch_pool_resource.go +++ b/internal/services/batch/batch_pool_resource.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" @@ -1521,7 +1521,7 @@ func startTaskSchema() map[string]*pluginsdk.Schema { }, }, }, - //lintignore:XS003 + // lintignore:XS003 "resource_file": { Type: pluginsdk.TypeList, Optional: true, diff --git a/internal/services/batch/client/client.go b/internal/services/batch/client/client.go index b79ded39fcca..224a0ebac2b9 100644 --- a/internal/services/batch/client/client.go +++ b/internal/services/batch/client/client.go @@ -5,7 +5,7 @@ import ( "fmt" batchDataplane "github.com/Azure/azure-sdk-for-go/services/batch/2020-03-01.11.0/batch" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" // nolint: staticcheck "github.com/Azure/go-autorest/autorest" "github.com/hashicorp/terraform-provider-azurerm/internal/common" "github.com/hashicorp/terraform-provider-azurerm/internal/services/batch/parse" diff --git a/internal/services/blueprints/blueprint.go b/internal/services/blueprints/blueprint.go index 9c6413f71cdd..9414a117d121 100644 --- a/internal/services/blueprints/blueprint.go +++ b/internal/services/blueprints/blueprint.go @@ -5,7 +5,7 @@ import ( "encoding/json" "fmt" - "github.com/Azure/azure-sdk-for-go/services/preview/blueprint/mgmt/2018-11-01-preview/blueprint" + "github.com/Azure/azure-sdk-for-go/services/preview/blueprint/mgmt/2018-11-01-preview/blueprint" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/blueprints/blueprint_assignment_resource.go b/internal/services/blueprints/blueprint_assignment_resource.go index 47f1691a33e7..1bc9772c4bd8 100644 --- a/internal/services/blueprints/blueprint_assignment_resource.go +++ b/internal/services/blueprints/blueprint_assignment_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/blueprint/mgmt/2018-11-01-preview/blueprint" + "github.com/Azure/azure-sdk-for-go/services/preview/blueprint/mgmt/2018-11-01-preview/blueprint" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/blueprints/client/client.go b/internal/services/blueprints/client/client.go index 47fe979fab4a..0277a4cd3828 100644 --- a/internal/services/blueprints/client/client.go +++ b/internal/services/blueprints/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/preview/blueprint/mgmt/2018-11-01-preview/blueprint" + "github.com/Azure/azure-sdk-for-go/services/preview/blueprint/mgmt/2018-11-01-preview/blueprint" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/bot/bot_channel_alexa_resource.go b/internal/services/bot/bot_channel_alexa_resource.go index 2e859e4dfc57..64951acb44a2 100644 --- a/internal/services/bot/bot_channel_alexa_resource.go +++ b/internal/services/bot/bot_channel_alexa_resource.go @@ -7,7 +7,7 @@ import ( "strconv" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/bot/bot_channel_alexa_resource_test.go b/internal/services/bot/bot_channel_alexa_resource_test.go index 088473dea3b6..26c0a1378471 100644 --- a/internal/services/bot/bot_channel_alexa_resource_test.go +++ b/internal/services/bot/bot_channel_alexa_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/google/uuid" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" diff --git a/internal/services/bot/bot_channel_direct_line_speech_resource.go b/internal/services/bot/bot_channel_direct_line_speech_resource.go index 44c8a57271aa..38def3fbcafc 100644 --- a/internal/services/bot/bot_channel_direct_line_speech_resource.go +++ b/internal/services/bot/bot_channel_direct_line_speech_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/bot/bot_channel_direct_line_speech_resource_test.go b/internal/services/bot/bot_channel_direct_line_speech_resource_test.go index f397c8101d8e..08977d00ad3e 100644 --- a/internal/services/bot/bot_channel_direct_line_speech_resource_test.go +++ b/internal/services/bot/bot_channel_direct_line_speech_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/bot/bot_channel_directline_resource.go b/internal/services/bot/bot_channel_directline_resource.go index 4098b406c525..93d16d47a78b 100644 --- a/internal/services/bot/bot_channel_directline_resource.go +++ b/internal/services/bot/bot_channel_directline_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/bot/bot_channel_directline_resource_test.go b/internal/services/bot/bot_channel_directline_resource_test.go index 7075c69aa5f5..45fad65b9965 100644 --- a/internal/services/bot/bot_channel_directline_resource_test.go +++ b/internal/services/bot/bot_channel_directline_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/bot/bot_channel_email_resource.go b/internal/services/bot/bot_channel_email_resource.go index 1bca72e9f51b..84d853a999e8 100644 --- a/internal/services/bot/bot_channel_email_resource.go +++ b/internal/services/bot/bot_channel_email_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/bot/bot_channel_email_resource_test.go b/internal/services/bot/bot_channel_email_resource_test.go index 37b3c3df81ef..ffe6b9491ee7 100644 --- a/internal/services/bot/bot_channel_email_resource_test.go +++ b/internal/services/bot/bot_channel_email_resource_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/bot/bot_channel_facebook_resource.go b/internal/services/bot/bot_channel_facebook_resource.go index ec56e43fc111..b9f41605b399 100644 --- a/internal/services/bot/bot_channel_facebook_resource.go +++ b/internal/services/bot/bot_channel_facebook_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/bot/bot_channel_facebook_resource_test.go b/internal/services/bot/bot_channel_facebook_resource_test.go index b3869ed8c14d..eaee63ecbc9c 100644 --- a/internal/services/bot/bot_channel_facebook_resource_test.go +++ b/internal/services/bot/bot_channel_facebook_resource_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/bot/bot_channel_line_resource.go b/internal/services/bot/bot_channel_line_resource.go index f068e155142b..345cb3957d0c 100644 --- a/internal/services/bot/bot_channel_line_resource.go +++ b/internal/services/bot/bot_channel_line_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/bot/bot_channel_line_resource_test.go b/internal/services/bot/bot_channel_line_resource_test.go index e2c0109ffad8..93045f724111 100644 --- a/internal/services/bot/bot_channel_line_resource_test.go +++ b/internal/services/bot/bot_channel_line_resource_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/bot/bot_channel_ms_teams_resource.go b/internal/services/bot/bot_channel_ms_teams_resource.go index f20edcf1802e..8529ca3d27ac 100644 --- a/internal/services/bot/bot_channel_ms_teams_resource.go +++ b/internal/services/bot/bot_channel_ms_teams_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/bot/bot_channel_ms_teams_resource_test.go b/internal/services/bot/bot_channel_ms_teams_resource_test.go index 9335548f546e..3071eabe3845 100644 --- a/internal/services/bot/bot_channel_ms_teams_resource_test.go +++ b/internal/services/bot/bot_channel_ms_teams_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/bot/bot_channel_slack_resource.go b/internal/services/bot/bot_channel_slack_resource.go index e0f91ed53802..7394dc69ff11 100644 --- a/internal/services/bot/bot_channel_slack_resource.go +++ b/internal/services/bot/bot_channel_slack_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/bot/bot_channel_slack_resource_test.go b/internal/services/bot/bot_channel_slack_resource_test.go index 7b4c39406265..516dd563b624 100644 --- a/internal/services/bot/bot_channel_slack_resource_test.go +++ b/internal/services/bot/bot_channel_slack_resource_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/bot/bot_channel_sms_resource.go b/internal/services/bot/bot_channel_sms_resource.go index d472f631da38..211094bb6b9a 100644 --- a/internal/services/bot/bot_channel_sms_resource.go +++ b/internal/services/bot/bot_channel_sms_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/bot/bot_channel_sms_resource_test.go b/internal/services/bot/bot_channel_sms_resource_test.go index 0150129413dd..e9b8604df7d3 100644 --- a/internal/services/bot/bot_channel_sms_resource_test.go +++ b/internal/services/bot/bot_channel_sms_resource_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/bot/bot_channel_web_chat_resource.go b/internal/services/bot/bot_channel_web_chat_resource.go index 2fa789d0431d..4bd23a7a332b 100644 --- a/internal/services/bot/bot_channel_web_chat_resource.go +++ b/internal/services/bot/bot_channel_web_chat_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/bot/bot_channel_web_chat_resource_test.go b/internal/services/bot/bot_channel_web_chat_resource_test.go index 5fe9e3b544dc..7f07655d460f 100644 --- a/internal/services/bot/bot_channel_web_chat_resource_test.go +++ b/internal/services/bot/bot_channel_web_chat_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/bot/bot_channels_registration_resource.go b/internal/services/bot/bot_channels_registration_resource.go index 47a7e44643b8..32258ee39a94 100644 --- a/internal/services/bot/bot_channels_registration_resource.go +++ b/internal/services/bot/bot_channels_registration_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/bot/bot_connection_resource.go b/internal/services/bot/bot_connection_resource.go index 1da3327e5b32..59a813eabfbd 100644 --- a/internal/services/bot/bot_connection_resource.go +++ b/internal/services/bot/bot_connection_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/bot/bot_healthbot_resource.go b/internal/services/bot/bot_healthbot_resource.go index ea75e4b7a61d..9a8e3226e0e7 100644 --- a/internal/services/bot/bot_healthbot_resource.go +++ b/internal/services/bot/bot_healthbot_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/healthbot/mgmt/2020-12-08/healthbot" + "github.com/Azure/azure-sdk-for-go/services/healthbot/mgmt/2020-12-08/healthbot" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/bot/bot_service_azure_bot_resource.go b/internal/services/bot/bot_service_azure_bot_resource.go index 032ee4a2e719..3a95937cc9a5 100644 --- a/internal/services/bot/bot_service_azure_bot_resource.go +++ b/internal/services/bot/bot_service_azure_bot_resource.go @@ -1,7 +1,7 @@ package bot import ( - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/bot/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/bot/bot_service_base_resource.go b/internal/services/bot/bot_service_base_resource.go index b0a0ede04190..be208ca17961 100644 --- a/internal/services/bot/bot_service_base_resource.go +++ b/internal/services/bot/bot_service_base_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/bot/bot_web_app_resource.go b/internal/services/bot/bot_web_app_resource.go index dc04c1e12771..ea56435a2cba 100644 --- a/internal/services/bot/bot_web_app_resource.go +++ b/internal/services/bot/bot_web_app_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/bot/client/client.go b/internal/services/bot/client/client.go index 24b1797b78fd..f7b8c0e65ab9 100644 --- a/internal/services/bot/client/client.go +++ b/internal/services/bot/client/client.go @@ -1,8 +1,8 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/healthbot/mgmt/2020-12-08/healthbot" - "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" + "github.com/Azure/azure-sdk-for-go/services/healthbot/mgmt/2020-12-08/healthbot" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/cdn/azuresdkhacks/cdn_frontdoor_route.go b/internal/services/cdn/azuresdkhacks/cdn_frontdoor_route.go index e93d5be1d62d..ec721cc2225c 100644 --- a/internal/services/cdn/azuresdkhacks/cdn_frontdoor_route.go +++ b/internal/services/cdn/azuresdkhacks/cdn_frontdoor_route.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/Azure/go-autorest/autorest" ) diff --git a/internal/services/cdn/cdn_endpoint_custom_domain_resource.go b/internal/services/cdn/cdn_endpoint_custom_domain_resource.go index 3dc453544d50..e3c3966e5d35 100644 --- a/internal/services/cdn/cdn_endpoint_custom_domain_resource.go +++ b/internal/services/cdn/cdn_endpoint_custom_domain_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/features" @@ -579,9 +579,7 @@ func flattenArmCdnEndpointCustomDomainUserManagedHttpsSettings(ctx context.Conte var certIdLiteral string cert, err := keyVaultsClient.ManagementClient.GetCertificate(ctx, *keyVaultBaseUrl, secretName, secretVersion) if err == nil && cert.ID != nil { - certId, err := keyvaultParse.ParseOptionallyVersionedNestedItemID(*cert.ID) - if err == nil { - } + certId, _ := keyvaultParse.ParseOptionallyVersionedNestedItemID(*cert.ID) certIdLiteral = certId.ID() if !isVersioned { certIdLiteral = certId.VersionlessID() diff --git a/internal/services/cdn/cdn_endpoint_resource.go b/internal/services/cdn/cdn_endpoint_resource.go index 2056aa749f65..768c079bd18a 100644 --- a/internal/services/cdn/cdn_endpoint_resource.go +++ b/internal/services/cdn/cdn_endpoint_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/cdn/cdn_frontdoor_custom_domain_resource.go b/internal/services/cdn/cdn_frontdoor_custom_domain_resource.go index d06ee13e6044..52c5e7b84573 100644 --- a/internal/services/cdn/cdn_frontdoor_custom_domain_resource.go +++ b/internal/services/cdn/cdn_frontdoor_custom_domain_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck dnsValidate "github.com/hashicorp/go-azure-sdk/resource-manager/dns/2018-05-01/zones" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -156,7 +156,7 @@ func resourceCdnFrontDoorCustomDomainCreate(d *pluginsdk.ResourceData, meta inte props.AFDDomainProperties.AzureDNSZone = expandResourceReference(dnsZone) } - tlsSettings, err := expandTlsParameters(tls, false) + tlsSettings, err := expandTlsParameters(tls) if err != nil { return err } @@ -319,7 +319,7 @@ func resourceCdnFrontDoorCustomDomainDelete(d *pluginsdk.ResourceData, meta inte return nil } -func expandTlsParameters(input []interface{}, isPreValidatedDomain bool) (*cdn.AFDDomainHTTPSParameters, error) { +func expandTlsParameters(input []interface{}) (*cdn.AFDDomainHTTPSParameters, error) { // NOTE: With the Frontdoor service, they do not treat an empty object like an empty object // if it is not nil they assume it is fully defined and then end up throwing errors when they // attempt to get a value from one of the fields. diff --git a/internal/services/cdn/cdn_frontdoor_endpoint_resource.go b/internal/services/cdn/cdn_frontdoor_endpoint_resource.go index 52bea3317a6c..25f63e22fc38 100644 --- a/internal/services/cdn/cdn_frontdoor_endpoint_resource.go +++ b/internal/services/cdn/cdn_frontdoor_endpoint_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/cdn/cdn_frontdoor_firewall_policy_data_source.go b/internal/services/cdn/cdn_frontdoor_firewall_policy_data_source.go index f93cd62d68d3..b23cffa5c81a 100644 --- a/internal/services/cdn/cdn_frontdoor_firewall_policy_data_source.go +++ b/internal/services/cdn/cdn_frontdoor_firewall_policy_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-11-01/frontdoor" + "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-11-01/frontdoor" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/parse" diff --git a/internal/services/cdn/cdn_frontdoor_firewall_policy_resource.go b/internal/services/cdn/cdn_frontdoor_firewall_policy_resource.go index 049a86828e21..ef307e0acc99 100644 --- a/internal/services/cdn/cdn_frontdoor_firewall_policy_resource.go +++ b/internal/services/cdn/cdn_frontdoor_firewall_policy_resource.go @@ -6,7 +6,7 @@ import ( "strconv" "time" - "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-11-01/frontdoor" + "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-11-01/frontdoor" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" diff --git a/internal/services/cdn/cdn_frontdoor_helpers.go b/internal/services/cdn/cdn_frontdoor_helpers.go index 449bd1d020e8..7fd09adfa0d7 100644 --- a/internal/services/cdn/cdn_frontdoor_helpers.go +++ b/internal/services/cdn/cdn_frontdoor_helpers.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" - "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-11-01/frontdoor" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-11-01/frontdoor" // nolint: staticcheck dnsValidate "github.com/hashicorp/go-azure-sdk/resource-manager/dns/2018-05-01/zones" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/features" @@ -501,7 +501,7 @@ func validateCustomDomainLinkToDefaultDomainState(resourceCustomDomains []interf return nil } -func validateRoutesCustomDomainProfile(customDomains []interface{}, routeName string, routeProfile string) error { +func validateRoutesCustomDomainProfile(customDomains []interface{}, routeProfile string) error { wrongProfile := make([]string, 0) if len(customDomains) != 0 { diff --git a/internal/services/cdn/cdn_frontdoor_origin_group_resource.go b/internal/services/cdn/cdn_frontdoor_origin_group_resource.go index 188a0565ac2c..15f2c65077cc 100644 --- a/internal/services/cdn/cdn_frontdoor_origin_group_resource.go +++ b/internal/services/cdn/cdn_frontdoor_origin_group_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/parse" diff --git a/internal/services/cdn/cdn_frontdoor_origin_resource.go b/internal/services/cdn/cdn_frontdoor_origin_resource.go index 718a0712e893..6760f197abd6 100644 --- a/internal/services/cdn/cdn_frontdoor_origin_resource.go +++ b/internal/services/cdn/cdn_frontdoor_origin_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/cdn/cdn_frontdoor_origin_resource_test.go b/internal/services/cdn/cdn_frontdoor_origin_resource_test.go index ce4cb9ec62c2..e98fdad1c969 100644 --- a/internal/services/cdn/cdn_frontdoor_origin_resource_test.go +++ b/internal/services/cdn/cdn_frontdoor_origin_resource_test.go @@ -206,6 +206,7 @@ func (r CdnFrontDoorOriginResource) Exists(ctx context.Context, clients *clients return utils.Bool(true), nil } +//nolint:unused func (r CdnFrontDoorOriginResource) templatePrivateLinkStorage(data acceptance.TestData) string { template := r.template(data, "Premium_AzureFrontDoor", false) return fmt.Sprintf(` @@ -232,6 +233,7 @@ resource "azurerm_storage_account" "test" { `, template, data.RandomString) } +// nolint: unused func (r CdnFrontDoorOriginResource) templatePrivateLinkStorageStaticWebSite(data acceptance.TestData) string { template := r.template(data, "Premium_AzureFrontDoor", false) return fmt.Sprintf(` @@ -264,6 +266,7 @@ resource "azurerm_storage_account" "test" { `, template, data.RandomString) } +// nolint: unused func (r CdnFrontDoorOriginResource) templatePrivateLinkLoadBalancer(data acceptance.TestData) string { template := r.template(data, "Premium_AzureFrontDoor", true) return fmt.Sprintf(` @@ -325,6 +328,7 @@ resource "azurerm_private_link_service" "test" { `, template, data.RandomInteger) } +//nolint:unused func (r CdnFrontDoorOriginResource) templatePrivateLinkWebApp(data acceptance.TestData) string { template := r.template(data, "Premium_AzureFrontDoor", false) return fmt.Sprintf(` @@ -525,6 +529,7 @@ resource "azurerm_cdn_frontdoor_origin" "test" { `, template, data.RandomInteger) } +// nolint: unused func (r CdnFrontDoorOriginResource) privateLinkBlobPrimary(data acceptance.TestData) string { template := r.templatePrivateLinkStorage(data) return fmt.Sprintf(` @@ -555,6 +560,7 @@ resource "azurerm_cdn_frontdoor_origin" "test" { `, template, data.RandomInteger) } +// nolint: unused func (r CdnFrontDoorOriginResource) privateLinkStaticWebSite(data acceptance.TestData) string { template := r.templatePrivateLinkStorageStaticWebSite(data) return fmt.Sprintf(` @@ -585,6 +591,7 @@ resource "azurerm_cdn_frontdoor_origin" "test" { `, template, data.RandomInteger) } +// nolint: unused func (r CdnFrontDoorOriginResource) privateLinkAppServices(data acceptance.TestData) string { template := r.templatePrivateLinkWebApp(data) return fmt.Sprintf(` @@ -615,6 +622,7 @@ resource "azurerm_cdn_frontdoor_origin" "test" { `, template, data.RandomInteger) } +// nolint: unused func (r CdnFrontDoorOriginResource) privateLinkLoadBalancer(data acceptance.TestData) string { template := r.templatePrivateLinkLoadBalancer(data) return fmt.Sprintf(` diff --git a/internal/services/cdn/cdn_frontdoor_profile_resource.go b/internal/services/cdn/cdn_frontdoor_profile_resource.go index 0312231345cd..79086f37d9b9 100644 --- a/internal/services/cdn/cdn_frontdoor_profile_resource.go +++ b/internal/services/cdn/cdn_frontdoor_profile_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/cdn/cdn_frontdoor_route_disable_link_to_default_domain_resource.go b/internal/services/cdn/cdn_frontdoor_route_disable_link_to_default_domain_resource.go index ea8f101cf869..f08d13887b94 100644 --- a/internal/services/cdn/cdn_frontdoor_route_disable_link_to_default_domain_resource.go +++ b/internal/services/cdn/cdn_frontdoor_route_disable_link_to_default_domain_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" diff --git a/internal/services/cdn/cdn_frontdoor_route_resource.go b/internal/services/cdn/cdn_frontdoor_route_resource.go index 4537ed9a56c4..17b3909e089e 100644 --- a/internal/services/cdn/cdn_frontdoor_route_resource.go +++ b/internal/services/cdn/cdn_frontdoor_route_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" @@ -254,7 +254,7 @@ func resourceCdnFrontDoorRouteCreate(d *pluginsdk.ResourceData, meta interface{} return err } - if err := validateRoutesCustomDomainProfile(normalizedCustomDomains, id.RouteName, id.ProfileName); err != nil { + if err := validateRoutesCustomDomainProfile(normalizedCustomDomains, id.ProfileName); err != nil { return err } } @@ -447,7 +447,7 @@ func resourceCdnFrontDoorRouteUpdate(d *pluginsdk.ResourceData, meta interface{} return err } - if err := validateRoutesCustomDomainProfile(customDomains, id.RouteName, id.ProfileName); err != nil { + if err := validateRoutesCustomDomainProfile(customDomains, id.ProfileName); err != nil { return err } } diff --git a/internal/services/cdn/cdn_frontdoor_rule_resource.go b/internal/services/cdn/cdn_frontdoor_rule_resource.go index 8844038cf67b..fb87f105be30 100644 --- a/internal/services/cdn/cdn_frontdoor_rule_resource.go +++ b/internal/services/cdn/cdn_frontdoor_rule_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - cdn "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + cdn "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" cdnFrontDoorRuleActions "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/frontdoorruleactions" diff --git a/internal/services/cdn/cdn_frontdoor_secret_data_source_test.go b/internal/services/cdn/cdn_frontdoor_secret_data_source_test.go index 77c5caed3195..11908d674456 100644 --- a/internal/services/cdn/cdn_frontdoor_secret_data_source_test.go +++ b/internal/services/cdn/cdn_frontdoor_secret_data_source_test.go @@ -1,9 +1,7 @@ package cdn_test import ( - "fmt" "os" - "strings" "testing" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" @@ -30,56 +28,3 @@ func TestAccCdnFrontDoorSecretDataSource_basic(t *testing.T) { data.ImportStep(), }) } - -func (r CdnFrontdoorSecretResourceDataSource) preCheck(t *testing.T) { - if r.DoNotRunFrontDoorCustomDomainTests == "" { - t.Skipf("`ARM_TEST_DO_NOT_RUN_CDN_FRONT_DOOR_CUSTOM_DOMAIN` must be set for acceptance tests") - } - - if strings.EqualFold(r.DoNotRunFrontDoorCustomDomainTests, "true") { - t.Skipf("`data.azurerm_cdn_frontdoor_secret` currently is not testable due to service requirements") - } -} - -func (r CdnFrontdoorSecretResourceDataSource) template(data acceptance.TestData) string { - return fmt.Sprintf(` -resource "azurerm_resource_group" "test" { - name = "acctestRG-cdn-afdx-%[1]d" - location = "%[2]s" -} - -resource "azurerm_cdn_frontdoor_profile" "test" { - name = "accTestProfile-%[1]d" - resource_group_name = azurerm_resource_group.test.name - sku_name = "Standard_AzureFrontDoor" -} - -resource "azurerm_cdn_frontdoor_secret" "test" { - name = "accTestSecret-%[1]d" - cdn_frontdoor_profile_id = azurerm_cdn_frontdoor_profile.test.id - - secret { - customer_certificate { - key_vault_certificate_id = azurerm_key_vault_certificate.test.id - } - } -} -`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) -} - -func (r CdnFrontdoorSecretResourceDataSource) basic(data acceptance.TestData) string { - template := r.template(data) - return fmt.Sprintf(` -provider "azurerm" { - features {} -} - -%s - -data "azurerm_cdn_frontdoor_secret" "test" { - name = azurerm_cdn_frontdoor_secret.test.name - profile_name = azurerm_cdn_frontdoor_profile.test.name - resource_group_name = azurerm_cdn_frontdoor_profile.test.resource_group_name -} -`, template) -} diff --git a/internal/services/cdn/cdn_frontdoor_secret_resource.go b/internal/services/cdn/cdn_frontdoor_secret_resource.go index 0397dddf0415..074ed8f29cfd 100644 --- a/internal/services/cdn/cdn_frontdoor_secret_resource.go +++ b/internal/services/cdn/cdn_frontdoor_secret_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" cdnFrontDoorsecretparams "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/frontdoorsecretparams" diff --git a/internal/services/cdn/cdn_frontdoor_security_policy_resource.go b/internal/services/cdn/cdn_frontdoor_security_policy_resource.go index ee8bb671f710..7f9a763c9d96 100644 --- a/internal/services/cdn/cdn_frontdoor_security_policy_resource.go +++ b/internal/services/cdn/cdn_frontdoor_security_policy_resource.go @@ -5,7 +5,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" cdnfrontdoorsecurityparams "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/frontdoorsecurityparams" diff --git a/internal/services/cdn/cdn_frontdoor_shared_schema.go b/internal/services/cdn/cdn_frontdoor_shared_schema.go index 449fbff7687d..e5f3f24a1c1f 100644 --- a/internal/services/cdn/cdn_frontdoor_shared_schema.go +++ b/internal/services/cdn/cdn_frontdoor_shared_schema.go @@ -1,7 +1,7 @@ package cdn import ( - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" diff --git a/internal/services/cdn/cdn_profile_resource.go b/internal/services/cdn/cdn_profile_resource.go index 7104e9f4a194..11ec03362cb5 100644 --- a/internal/services/cdn/cdn_profile_resource.go +++ b/internal/services/cdn/cdn_profile_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/cdn/client/client.go b/internal/services/cdn/client/client.go index bf75b270da9d..44b54beee5f6 100644 --- a/internal/services/cdn/client/client.go +++ b/internal/services/cdn/client/client.go @@ -1,9 +1,9 @@ package client import ( - cdnSdk "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" - cdnFrontDoorSdk "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" - "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-11-01/frontdoor" + cdnSdk "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck + cdnFrontDoorSdk "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-11-01/frontdoor" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/cdn/deliveryruleactions/cache_expiration.go b/internal/services/cdn/deliveryruleactions/cache_expiration.go index ffeebece03b9..10f82d5e70b5 100644 --- a/internal/services/cdn/deliveryruleactions/cache_expiration.go +++ b/internal/services/cdn/deliveryruleactions/cache_expiration.go @@ -3,7 +3,7 @@ package deliveryruleactions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" diff --git a/internal/services/cdn/deliveryruleactions/cache_key_query_string.go b/internal/services/cdn/deliveryruleactions/cache_key_query_string.go index ff2393137040..89dafe9c73d8 100644 --- a/internal/services/cdn/deliveryruleactions/cache_key_query_string.go +++ b/internal/services/cdn/deliveryruleactions/cache_key_query_string.go @@ -3,7 +3,7 @@ package deliveryruleactions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleactions/modify_request_header.go b/internal/services/cdn/deliveryruleactions/modify_request_header.go index 1c86bbe087a6..f1deaba40c45 100644 --- a/internal/services/cdn/deliveryruleactions/modify_request_header.go +++ b/internal/services/cdn/deliveryruleactions/modify_request_header.go @@ -3,7 +3,7 @@ package deliveryruleactions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleactions/modify_response_header.go b/internal/services/cdn/deliveryruleactions/modify_response_header.go index b092eba0eec0..99814fad7c1c 100644 --- a/internal/services/cdn/deliveryruleactions/modify_response_header.go +++ b/internal/services/cdn/deliveryruleactions/modify_response_header.go @@ -3,7 +3,7 @@ package deliveryruleactions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleactions/url_redirect.go b/internal/services/cdn/deliveryruleactions/url_redirect.go index 146200972d27..26cf323b8d55 100644 --- a/internal/services/cdn/deliveryruleactions/url_redirect.go +++ b/internal/services/cdn/deliveryruleactions/url_redirect.go @@ -3,7 +3,7 @@ package deliveryruleactions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" diff --git a/internal/services/cdn/deliveryruleactions/url_rewrite.go b/internal/services/cdn/deliveryruleactions/url_rewrite.go index 4cb2cd71116c..40e586046750 100644 --- a/internal/services/cdn/deliveryruleactions/url_rewrite.go +++ b/internal/services/cdn/deliveryruleactions/url_rewrite.go @@ -3,7 +3,7 @@ package deliveryruleactions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/cookies.go b/internal/services/cdn/deliveryruleconditions/cookies.go index 1d9232e4896a..7da8f759db35 100644 --- a/internal/services/cdn/deliveryruleconditions/cookies.go +++ b/internal/services/cdn/deliveryruleconditions/cookies.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/device.go b/internal/services/cdn/deliveryruleconditions/device.go index e49065ab951a..f94b6cd486ff 100644 --- a/internal/services/cdn/deliveryruleconditions/device.go +++ b/internal/services/cdn/deliveryruleconditions/device.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/http_version.go b/internal/services/cdn/deliveryruleconditions/http_version.go index ea657535f777..c240de363b17 100644 --- a/internal/services/cdn/deliveryruleconditions/http_version.go +++ b/internal/services/cdn/deliveryruleconditions/http_version.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/post_arg.go b/internal/services/cdn/deliveryruleconditions/post_arg.go index 3058e9e1e769..15f3ff45768a 100644 --- a/internal/services/cdn/deliveryruleconditions/post_arg.go +++ b/internal/services/cdn/deliveryruleconditions/post_arg.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/query_string.go b/internal/services/cdn/deliveryruleconditions/query_string.go index d203a0fb8634..a0099cdc7e4d 100644 --- a/internal/services/cdn/deliveryruleconditions/query_string.go +++ b/internal/services/cdn/deliveryruleconditions/query_string.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/remote_address.go b/internal/services/cdn/deliveryruleconditions/remote_address.go index fb0bf1dac119..6aea1ebc5eec 100644 --- a/internal/services/cdn/deliveryruleconditions/remote_address.go +++ b/internal/services/cdn/deliveryruleconditions/remote_address.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/request_body.go b/internal/services/cdn/deliveryruleconditions/request_body.go index 27b1f9296abd..1cc298f2f97b 100644 --- a/internal/services/cdn/deliveryruleconditions/request_body.go +++ b/internal/services/cdn/deliveryruleconditions/request_body.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/request_header.go b/internal/services/cdn/deliveryruleconditions/request_header.go index a8a74234998b..7387f818044d 100644 --- a/internal/services/cdn/deliveryruleconditions/request_header.go +++ b/internal/services/cdn/deliveryruleconditions/request_header.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/request_method.go b/internal/services/cdn/deliveryruleconditions/request_method.go index 5c60f1de2fd6..3651bd3deac2 100644 --- a/internal/services/cdn/deliveryruleconditions/request_method.go +++ b/internal/services/cdn/deliveryruleconditions/request_method.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/request_scheme.go b/internal/services/cdn/deliveryruleconditions/request_scheme.go index 671f91ba1836..ccde8aa033d0 100644 --- a/internal/services/cdn/deliveryruleconditions/request_scheme.go +++ b/internal/services/cdn/deliveryruleconditions/request_scheme.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/request_uri.go b/internal/services/cdn/deliveryruleconditions/request_uri.go index dff82be951bf..343a543029c3 100644 --- a/internal/services/cdn/deliveryruleconditions/request_uri.go +++ b/internal/services/cdn/deliveryruleconditions/request_uri.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/url_file_extension.go b/internal/services/cdn/deliveryruleconditions/url_file_extension.go index f28afd065da3..1217dfd08d29 100644 --- a/internal/services/cdn/deliveryruleconditions/url_file_extension.go +++ b/internal/services/cdn/deliveryruleconditions/url_file_extension.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/url_file_name.go b/internal/services/cdn/deliveryruleconditions/url_file_name.go index 131257c7b5ee..3dcdc392a47e 100644 --- a/internal/services/cdn/deliveryruleconditions/url_file_name.go +++ b/internal/services/cdn/deliveryruleconditions/url_file_name.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/deliveryruleconditions/url_path.go b/internal/services/cdn/deliveryruleconditions/url_path.go index a90aa2c6aa6f..0cf018dea9f1 100644 --- a/internal/services/cdn/deliveryruleconditions/url_path.go +++ b/internal/services/cdn/deliveryruleconditions/url_path.go @@ -3,7 +3,7 @@ package deliveryruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/endpoint_delivery_rule.go b/internal/services/cdn/endpoint_delivery_rule.go index 0367efd51919..d417227b640d 100644 --- a/internal/services/cdn/endpoint_delivery_rule.go +++ b/internal/services/cdn/endpoint_delivery_rule.go @@ -1,7 +1,7 @@ package cdn import ( - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/deliveryruleactions" "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/deliveryruleconditions" "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/validate" diff --git a/internal/services/cdn/endpoint_global_delivery_rule.go b/internal/services/cdn/endpoint_global_delivery_rule.go index ec9ebecd9d7d..2f1bb2cd4dcd 100644 --- a/internal/services/cdn/endpoint_global_delivery_rule.go +++ b/internal/services/cdn/endpoint_global_delivery_rule.go @@ -1,14 +1,14 @@ package cdn import ( - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/deliveryruleactions" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) func endpointGlobalDeliveryRule() *pluginsdk.Schema { - //lintignore:XS003 + // lintignore:XS003 return &pluginsdk.Schema{ Type: pluginsdk.TypeList, Optional: true, diff --git a/internal/services/cdn/frontdoorruleactions/cdn_frontdoor_rule_actions.go b/internal/services/cdn/frontdoorruleactions/cdn_frontdoor_rule_actions.go index 8ffc6f0eeb7f..6adaff14b838 100644 --- a/internal/services/cdn/frontdoorruleactions/cdn_frontdoor_rule_actions.go +++ b/internal/services/cdn/frontdoorruleactions/cdn_frontdoor_rule_actions.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/parse" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/frontdoorruleconditions/cdn_frontdoor_rule_conditions.go b/internal/services/cdn/frontdoorruleconditions/cdn_frontdoor_rule_conditions.go index 3b181a973df9..36655572f89f 100644 --- a/internal/services/cdn/frontdoorruleconditions/cdn_frontdoor_rule_conditions.go +++ b/internal/services/cdn/frontdoorruleconditions/cdn_frontdoor_rule_conditions.go @@ -3,7 +3,7 @@ package CdnFrontDoorruleconditions import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" cdnValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/cdn/frontdoorsecretparams/cdn_frontdoor_secret_params.go b/internal/services/cdn/frontdoorsecretparams/cdn_frontdoor_secret_params.go index d9b9829b6eca..a21caa54803f 100644 --- a/internal/services/cdn/frontdoorsecretparams/cdn_frontdoor_secret_params.go +++ b/internal/services/cdn/frontdoorsecretparams/cdn_frontdoor_secret_params.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" keyVaultParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/parse" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cdn/frontdoorsecurityparams/cdn_frontdoor_security_params.go b/internal/services/cdn/frontdoorsecurityparams/cdn_frontdoor_security_params.go index 25426c85cf6a..4cce65f4b610 100644 --- a/internal/services/cdn/frontdoorsecurityparams/cdn_frontdoor_security_params.go +++ b/internal/services/cdn/frontdoorsecurityparams/cdn_frontdoor_security_params.go @@ -3,7 +3,7 @@ package cdnfrontdoorsecurityparams import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/cdn/validate/front_door_route_https_redirect.go b/internal/services/cdn/validate/front_door_route_https_redirect.go index 03981050995c..c437bd22e936 100644 --- a/internal/services/cdn/validate/front_door_route_https_redirect.go +++ b/internal/services/cdn/validate/front_door_route_https_redirect.go @@ -3,7 +3,7 @@ package validate import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/cdn/validate/front_door_validation_helpers.go b/internal/services/cdn/validate/front_door_validation_helpers.go index 70a482a25424..5fedb32eb988 100644 --- a/internal/services/cdn/validate/front_door_validation_helpers.go +++ b/internal/services/cdn/validate/front_door_validation_helpers.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" + "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" ) diff --git a/internal/services/cognitive/cognitive_account_resource.go b/internal/services/cognitive/cognitive_account_resource.go index 14cdb8b0a347..508427126aee 100644 --- a/internal/services/cognitive/cognitive_account_resource.go +++ b/internal/services/cognitive/cognitive_account_resource.go @@ -566,7 +566,7 @@ func resourceCognitiveAccountRead(d *pluginsdk.ResourceData, meta interface{}) e if props.RestrictOutboundNetworkAccess != nil { outboundNetworkAccessRestricted = *props.RestrictOutboundNetworkAccess } - //lintignore:R001 + // lintignore:R001 d.Set("outbound_network_access_restricted", outboundNetworkAccessRestricted) localAuthEnabled := true @@ -575,7 +575,7 @@ func resourceCognitiveAccountRead(d *pluginsdk.ResourceData, meta interface{}) e } d.Set("local_auth_enabled", localAuthEnabled) - customerManagedKey, err := flattenCognitiveAccountCustomerManagedKey(id, props.Encryption) + customerManagedKey, err := flattenCognitiveAccountCustomerManagedKey(props.Encryption) if err != nil { return err } @@ -789,7 +789,6 @@ func flattenCognitiveAccountNetworkAcls(input *cognitiveservicesaccounts.Network } } - virtualNetworkSubnetIds := make([]interface{}, 0) virtualNetworkRules := make([]interface{}, 0) if input.VirtualNetworkRules != nil { for _, v := range *input.VirtualNetworkRules { @@ -799,7 +798,6 @@ func flattenCognitiveAccountNetworkAcls(input *cognitiveservicesaccounts.Network id = subnetId.ID() } - virtualNetworkSubnetIds = append(virtualNetworkSubnetIds, id) virtualNetworkRules = append(virtualNetworkRules, map[string]interface{}{ "subnet_id": id, "ignore_missing_vnet_service_endpoint": *v.IgnoreMissingVnetServiceEndpoint, @@ -857,7 +855,7 @@ func expandCognitiveAccountCustomerManagedKey(input []interface{}) *cognitiveser } } -func flattenCognitiveAccountCustomerManagedKey(cognitiveAccountId *cognitiveservicesaccounts.AccountId, input *cognitiveservicesaccounts.Encryption) ([]interface{}, error) { +func flattenCognitiveAccountCustomerManagedKey(input *cognitiveservicesaccounts.Encryption) ([]interface{}, error) { if input == nil { return []interface{}{}, nil } diff --git a/internal/services/compute/client/client.go b/internal/services/compute/client/client.go index 78e17601d623..f0742b196cc7 100644 --- a/internal/services/compute/client/client.go +++ b/internal/services/compute/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/marketplaceordering/mgmt/2015-06-01/marketplaceordering" + "github.com/Azure/azure-sdk-for-go/services/marketplaceordering/mgmt/2015-06-01/marketplaceordering" // nolint: staticcheck "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/availabilitysets" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups" diff --git a/internal/services/compute/disk_sas_token_resource.go b/internal/services/compute/disk_sas_token_resource.go index 5664769a740b..e1a5accf4e54 100644 --- a/internal/services/compute/disk_sas_token_resource.go +++ b/internal/services/compute/disk_sas_token_resource.go @@ -127,7 +127,7 @@ func resourceManagedDiskSasTokenCreate(d *pluginsdk.ResourceData, meta interface } var result Result - err = json.Unmarshal([]byte(buf.String()), &result) + err = json.Unmarshal(buf.Bytes(), &result) if err != nil { return fmt.Errorf("retrieving SAS Token for Disk Access %s: %+v", *diskId, err) } diff --git a/internal/services/compute/linux_virtual_machine_resource.go b/internal/services/compute/linux_virtual_machine_resource.go index b32c3d1d75ab..964aed1bc8ec 100644 --- a/internal/services/compute/linux_virtual_machine_resource.go +++ b/internal/services/compute/linux_virtual_machine_resource.go @@ -446,10 +446,7 @@ func resourceLinuxVirtualMachineCreate(d *pluginsdk.ResourceData, meta interface sourceImageReferenceRaw := d.Get("source_image_reference").([]interface{}) sourceImageId := d.Get("source_image_id").(string) - sourceImageReference, err := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) - if err != nil { - return err - } + sourceImageReference := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) sshKeysRaw := d.Get("admin_ssh_key").(*pluginsdk.Set).List() sshKeys := ExpandSSHKeys(sshKeysRaw) diff --git a/internal/services/compute/linux_virtual_machine_resource_other_test.go b/internal/services/compute/linux_virtual_machine_resource_other_test.go index b89729fc6f81..a58d55243405 100644 --- a/internal/services/compute/linux_virtual_machine_resource_other_test.go +++ b/internal/services/compute/linux_virtual_machine_resource_other_test.go @@ -892,6 +892,7 @@ resource "azurerm_linux_virtual_machine" "test" { `, r.template(data), data.RandomInteger) } +// nolint: unused func (r LinuxVirtualMachineResource) otherPatchAssessmentModeAutomaticByPlatform(data acceptance.TestData) string { return fmt.Sprintf(` %s diff --git a/internal/services/compute/linux_virtual_machine_scale_set_disk_os_resource_test.go b/internal/services/compute/linux_virtual_machine_scale_set_disk_os_resource_test.go index f567b68f8dc5..4097781ddbb6 100644 --- a/internal/services/compute/linux_virtual_machine_scale_set_disk_os_resource_test.go +++ b/internal/services/compute/linux_virtual_machine_scale_set_disk_os_resource_test.go @@ -542,52 +542,6 @@ resource "azurerm_linux_virtual_machine_scale_set" "test" { `, r.template(data), data.RandomInteger) } -func (r LinuxVirtualMachineScaleSetResource) disksOSDiskEphemeralResourceDisk(data acceptance.TestData) string { - return fmt.Sprintf(` -%s - -resource "azurerm_linux_virtual_machine_scale_set" "test" { - name = "acctestvmss-%d" - resource_group_name = azurerm_resource_group.test.name - location = azurerm_resource_group.test.location - sku = "Standard_F2s_v2" - instances = 1 - admin_username = "adminuser" - admin_password = "P@ssword1234!" - - disable_password_authentication = false - - source_image_reference { - publisher = "Canonical" - offer = "UbuntuServer" - sku = "16.04-LTS" - version = "latest" - } - - os_disk { - storage_account_type = "Standard_LRS" - caching = "ReadOnly" - - diff_disk_settings { - option = "Local" - placement = "ResourceDisk" - } - } - - network_interface { - name = "example" - primary = true - - ip_configuration { - name = "internal" - primary = true - subnet_id = azurerm_subnet.test.id - } - } -} -`, r.template(data), data.RandomInteger) -} - func (r LinuxVirtualMachineScaleSetResource) disksOSDiskStorageAccountType(data acceptance.TestData, storageAccountType string) string { return fmt.Sprintf(` %s diff --git a/internal/services/compute/linux_virtual_machine_scale_set_network_resource_test.go b/internal/services/compute/linux_virtual_machine_scale_set_network_resource_test.go index db516cbb2f71..3f671a4d1492 100644 --- a/internal/services/compute/linux_virtual_machine_scale_set_network_resource_test.go +++ b/internal/services/compute/linux_virtual_machine_scale_set_network_resource_test.go @@ -1585,6 +1585,8 @@ resource "azurerm_linux_virtual_machine_scale_set" "test" { `, r.template(data), data.RandomInteger, data.RandomInteger) } +// skipped +// nolint:unused func (r LinuxVirtualMachineScaleSetResource) networkPublicIPVersion(data acceptance.TestData) string { return fmt.Sprintf(` %s diff --git a/internal/services/compute/linux_virtual_machine_scale_set_resource.go b/internal/services/compute/linux_virtual_machine_scale_set_resource.go index 43306c0442c9..bfd742ccd1b9 100644 --- a/internal/services/compute/linux_virtual_machine_scale_set_resource.go +++ b/internal/services/compute/linux_virtual_machine_scale_set_resource.go @@ -112,10 +112,7 @@ func resourceLinuxVirtualMachineScaleSetCreate(d *pluginsdk.ResourceData, meta i sourceImageReferenceRaw := d.Get("source_image_reference").([]interface{}) sourceImageId := d.Get("source_image_id").(string) - sourceImageReference, err := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) - if err != nil { - return err - } + sourceImageReference := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) sshKeysRaw := d.Get("admin_ssh_key").(*pluginsdk.Set).List() sshKeys := ExpandSSHKeys(sshKeysRaw) @@ -629,10 +626,7 @@ func resourceLinuxVirtualMachineScaleSetUpdate(d *pluginsdk.ResourceData, meta i if d.HasChange("source_image_id") || d.HasChange("source_image_reference") { sourceImageReferenceRaw := d.Get("source_image_reference").([]interface{}) sourceImageId := d.Get("source_image_id").(string) - sourceImageReference, err := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) - if err != nil { - return err - } + sourceImageReference := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) // Must include all storage profile properties when updating disk image. See: https://github.com/hashicorp/terraform-provider-azurerm/issues/8273 updateProps.VirtualMachineProfile.StorageProfile.DataDisks = existing.VirtualMachineScaleSetProperties.VirtualMachineProfile.StorageProfile.DataDisks diff --git a/internal/services/compute/managed_disk_resource.go b/internal/services/compute/managed_disk_resource.go index 5080e48a6a0e..08716547fb51 100644 --- a/internal/services/compute/managed_disk_resource.go +++ b/internal/services/compute/managed_disk_resource.go @@ -683,10 +683,7 @@ func resourceManagedDiskUpdate(d *pluginsdk.ResourceData, meta interface{}) erro if oldSize, newSize := d.GetChange("disk_size_gb"); newSize.(int) > oldSize.(int) { canBeResizedWithoutDowntime := false if meta.(*clients.Client).Features.ManagedDisk.ExpandWithoutDowntime { - diskSupportsNoDowntimeResize, err := determineIfDataDiskSupportsNoDowntimeResize(disk.Model, oldSize.(int), newSize.(int)) - if err != nil { - return fmt.Errorf("determining if the Disk supports no-downtime-resize: %+v", err) - } + diskSupportsNoDowntimeResize := determineIfDataDiskSupportsNoDowntimeResize(disk.Model, oldSize.(int), newSize.(int)) vmSkuSupportsNoDowntimeResize, err := determineIfVirtualMachineSkuSupportsNoDowntimeResize(ctx, disk.Model.ManagedBy, virtualMachinesClient, skusClient) if err != nil { diff --git a/internal/services/compute/managed_disk_resource_test.go b/internal/services/compute/managed_disk_resource_test.go index daffde02c125..f667d49e9bfb 100644 --- a/internal/services/compute/managed_disk_resource_test.go +++ b/internal/services/compute/managed_disk_resource_test.go @@ -756,24 +756,6 @@ func (ManagedDiskResource) Exists(ctx context.Context, clients *clients.Client, return utils.Bool(resp.Model != nil), nil } -func (ManagedDiskResource) destroyVirtualMachine(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) error { - vmName := state.Attributes["name"] - resourceGroup := state.Attributes["resource_group_name"] - - // this is a preview feature we don't want to use right now - var forceDelete *bool = nil - future, err := client.Compute.VMClient.Delete(ctx, resourceGroup, vmName, forceDelete) - if err != nil { - return fmt.Errorf("Bad: Delete on vmClient: %+v", err) - } - - if err = future.WaitForCompletionRef(ctx, client.Compute.VMClient.Client); err != nil { - return fmt.Errorf("Bad: Delete on vmClient: %+v", err) - } - - return nil -} - func (ManagedDiskResource) empty(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { diff --git a/internal/services/compute/no_downtime_resize.go b/internal/services/compute/no_downtime_resize.go index 8fd32a7f3d4b..7f2f50adefb0 100644 --- a/internal/services/compute/no_downtime_resize.go +++ b/internal/services/compute/no_downtime_resize.go @@ -20,28 +20,28 @@ import ( // @tombuildsstuff: this is intentionally split out into it's own file since this'll need to be reused -func determineIfDataDiskSupportsNoDowntimeResize(disk *disks.Disk, oldSizeGb, newSizeGb int) (*bool, error) { +func determineIfDataDiskSupportsNoDowntimeResize(disk *disks.Disk, oldSizeGb, newSizeGb int) *bool { if disk == nil || disk.Properties == nil || disk.Sku == nil { - return pointer.To(false), nil + return pointer.To(false) } // Only supported for data disks. isDataDisk := disk.Properties.OsType != nil && string(*disk.Properties.OsType) != "" if isDataDisk { - return pointer.To(false), nil + return pointer.To(false) } // Not supported for shared disks. isSharedDisk := disk.Properties.MaxShares != nil && *disk.Properties.MaxShares >= 0 if isSharedDisk { log.Printf("[DEBUG] Disk is shared so does not support no-downtime-resize") - return pointer.To(false), nil + return pointer.To(false) } // If a disk is 4 TiB or less, you can't expand it beyond 4 TiB without deallocating the VM. // If a disk is already greater than 4 TiB, you can expand it without deallocating the VM. if oldSizeGb < 4096 && newSizeGb >= 4096 { - return pointer.To(false), nil + return pointer.To(false) } // Not supported for Ultra disks or Premium SSD v2 disks. @@ -59,7 +59,7 @@ func determineIfDataDiskSupportsNoDowntimeResize(disk *disks.Disk, oldSizeGb, ne } } } - return pointer.To(diskTypeIsSupported), nil + return pointer.To(diskTypeIsSupported) } func determineIfVirtualMachineSkuSupportsNoDowntimeResize(ctx context.Context, virtualMachineIdRaw *string, virtualMachinesClient *virtualmachines.VirtualMachinesClient, skusClient *skus.SkusClient) (*bool, error) { diff --git a/internal/services/compute/orchestrated_virtual_machine_scale_set_resource.go b/internal/services/compute/orchestrated_virtual_machine_scale_set_resource.go index c8df6e5e9ae8..c1e950d73166 100644 --- a/internal/services/compute/orchestrated_virtual_machine_scale_set_resource.go +++ b/internal/services/compute/orchestrated_virtual_machine_scale_set_resource.go @@ -380,10 +380,7 @@ func resourceOrchestratedVirtualMachineScaleSetCreate(d *pluginsdk.ResourceData, sourceImageReferenceRaw := d.Get("source_image_reference").([]interface{}) sourceImageId := d.Get("source_image_id").(string) if len(sourceImageReferenceRaw) != 0 || sourceImageId != "" { - sourceImageReference, err := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) - if err != nil { - return err - } + sourceImageReference := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) virtualMachineProfile.StorageProfile.ImageReference = sourceImageReference } @@ -936,10 +933,7 @@ func resourceOrchestratedVirtualMachineScaleSetUpdate(d *pluginsdk.ResourceData, sourceImageId := d.Get("source_image_id").(string) if len(sourceImageReferenceRaw) != 0 || sourceImageId != "" { - sourceImageReference, err := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) - if err != nil { - return err - } + sourceImageReference := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) updateProps.VirtualMachineProfile.StorageProfile.ImageReference = sourceImageReference } diff --git a/internal/services/compute/shared_image_resource.go b/internal/services/compute/shared_image_resource.go index 0d02e1e2b696..d297aae1a0f3 100644 --- a/internal/services/compute/shared_image_resource.go +++ b/internal/services/compute/shared_image_resource.go @@ -367,9 +367,7 @@ func resourceSharedImageRead(d *pluginsdk.ResourceData, meta interface{}) error diskTypesNotAllowed := make([]string, 0) if disallowed := props.Disallowed; disallowed != nil { if disallowed.DiskTypes != nil { - for _, v := range *disallowed.DiskTypes { - diskTypesNotAllowed = append(diskTypesNotAllowed, v) - } + diskTypesNotAllowed = append(diskTypesNotAllowed, *disallowed.DiskTypes...) } } d.Set("disk_types_not_allowed", diskTypesNotAllowed) diff --git a/internal/services/compute/shared_schema.go b/internal/services/compute/shared_schema.go index 7d63d1d02308..ce3a7063a4dc 100644 --- a/internal/services/compute/shared_schema.go +++ b/internal/services/compute/shared_schema.go @@ -95,7 +95,7 @@ func flattenAdditionalUnattendContent(input *[]compute.AdditionalUnattendContent } func bootDiagnosticsSchema() *pluginsdk.Schema { - //lintignore:XS003 + // lintignore:XS003 return &pluginsdk.Schema{ Type: pluginsdk.TypeList, Optional: true, @@ -437,14 +437,14 @@ func isValidHotPatchSourceImageReference(referenceInput []interface{}, imageId s return false } -func expandSourceImageReference(referenceInput []interface{}, imageId string) (*compute.ImageReference, error) { +func expandSourceImageReference(referenceInput []interface{}, imageId string) *compute.ImageReference { if imageId != "" { // With Version : "/communityGalleries/publicGalleryName/images/myGalleryImageName/versions/(major.minor.patch | latest)" // Versionless(e.g. latest): "/communityGalleries/publicGalleryName/images/myGalleryImageName" if _, errors := validation.Any(validate.CommunityGalleryImageID, validate.CommunityGalleryImageVersionID)(imageId, "source_image_id"); len(errors) == 0 { return &compute.ImageReference{ CommunityGalleryImageID: utils.String(imageId), - }, nil + } } // With Version : "/sharedGalleries/galleryUniqueName/images/myGalleryImageName/versions/(major.minor.patch | latest)" @@ -452,12 +452,12 @@ func expandSourceImageReference(referenceInput []interface{}, imageId string) (* if _, errors := validation.Any(validate.SharedGalleryImageID, validate.SharedGalleryImageVersionID)(imageId, "source_image_id"); len(errors) == 0 { return &compute.ImageReference{ SharedGalleryImageID: utils.String(imageId), - }, nil + } } return &compute.ImageReference{ ID: utils.String(imageId), - }, nil + } } raw := referenceInput[0].(map[string]interface{}) @@ -466,7 +466,7 @@ func expandSourceImageReference(referenceInput []interface{}, imageId string) (* Offer: utils.String(raw["offer"].(string)), Sku: utils.String(raw["sku"].(string)), Version: utils.String(raw["version"].(string)), - }, nil + } } func flattenSourceImageReference(input *compute.ImageReference, hasImageId bool) []interface{} { diff --git a/internal/services/compute/virtual_machine_scale_set.go b/internal/services/compute/virtual_machine_scale_set.go index 66d2ded9ce73..39259d5d9350 100644 --- a/internal/services/compute/virtual_machine_scale_set.go +++ b/internal/services/compute/virtual_machine_scale_set.go @@ -2167,7 +2167,7 @@ func virtualMachineScaleSetExtensionHash(v interface{}) int { if v, ok := m["protected_settings_from_key_vault"]; ok { protectedSettingsFromKeyVault := v.([]interface{}) - if protectedSettingsFromKeyVault != nil && len(protectedSettingsFromKeyVault) > 0 { + if len(protectedSettingsFromKeyVault) > 0 { buf.WriteString(fmt.Sprintf("%s-", protectedSettingsFromKeyVault[0].(map[string]interface{})["secret_url"].(string))) buf.WriteString(fmt.Sprintf("%s-", protectedSettingsFromKeyVault[0].(map[string]interface{})["source_vault_id"].(string))) } diff --git a/internal/services/compute/windows_virtual_machine_resource.go b/internal/services/compute/windows_virtual_machine_resource.go index 58d3df173de0..6f060dbb3c89 100644 --- a/internal/services/compute/windows_virtual_machine_resource.go +++ b/internal/services/compute/windows_virtual_machine_resource.go @@ -481,10 +481,7 @@ func resourceWindowsVirtualMachineCreate(d *pluginsdk.ResourceData, meta interfa sourceImageReferenceRaw := d.Get("source_image_reference").([]interface{}) sourceImageId := d.Get("source_image_id").(string) - sourceImageReference, err := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) - if err != nil { - return err - } + sourceImageReference := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) winRmListenersRaw := d.Get("winrm_listener").(*pluginsdk.Set).List() winRmListeners := expandWinRMListener(winRmListenersRaw) diff --git a/internal/services/compute/windows_virtual_machine_resource_other_test.go b/internal/services/compute/windows_virtual_machine_resource_other_test.go index 3f1a8597ef11..41e70cae0720 100644 --- a/internal/services/compute/windows_virtual_machine_resource_other_test.go +++ b/internal/services/compute/windows_virtual_machine_resource_other_test.go @@ -1277,6 +1277,7 @@ resource "azurerm_windows_virtual_machine" "test" { `, r.template(data)) } +//nolint:unused func (r WindowsVirtualMachineResource) otherPatchAssessmentModeAutomaticByPlatform(data acceptance.TestData) string { return fmt.Sprintf(` %s diff --git a/internal/services/compute/windows_virtual_machine_scale_set_network_resource_test.go b/internal/services/compute/windows_virtual_machine_scale_set_network_resource_test.go index ef07f1f3d16b..161ea6cd43ba 100644 --- a/internal/services/compute/windows_virtual_machine_scale_set_network_resource_test.go +++ b/internal/services/compute/windows_virtual_machine_scale_set_network_resource_test.go @@ -1639,6 +1639,7 @@ resource "azurerm_windows_virtual_machine_scale_set" "test" { `, r.template(data), data.RandomInteger, data.RandomStringOfLength(9)) } +//nolint:unused func (r WindowsVirtualMachineScaleSetResource) networkPublicIPVersion(data acceptance.TestData) string { return fmt.Sprintf(` %s diff --git a/internal/services/compute/windows_virtual_machine_scale_set_resource.go b/internal/services/compute/windows_virtual_machine_scale_set_resource.go index dfbe406d7d6a..fa65f38c6541 100644 --- a/internal/services/compute/windows_virtual_machine_scale_set_resource.go +++ b/internal/services/compute/windows_virtual_machine_scale_set_resource.go @@ -112,10 +112,7 @@ func resourceWindowsVirtualMachineScaleSetCreate(d *pluginsdk.ResourceData, meta sourceImageReferenceRaw := d.Get("source_image_reference").([]interface{}) sourceImageId := d.Get("source_image_id").(string) - sourceImageReference, err := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) - if err != nil { - return err - } + sourceImageReference := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) provisionVMAgent := d.Get("provision_vm_agent").(bool) zones := zones.ExpandUntyped(d.Get("zones").(*schema.Set).List()) @@ -638,10 +635,7 @@ func resourceWindowsVirtualMachineScaleSetUpdate(d *pluginsdk.ResourceData, meta if d.HasChange("source_image_id") || d.HasChange("source_image_reference") { sourceImageReferenceRaw := d.Get("source_image_reference").([]interface{}) sourceImageId := d.Get("source_image_id").(string) - sourceImageReference, err := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) - if err != nil { - return err - } + sourceImageReference := expandSourceImageReference(sourceImageReferenceRaw, sourceImageId) // Must include all storage profile properties when updating disk image. See: https://github.com/hashicorp/terraform-provider-azurerm/issues/8273 updateProps.VirtualMachineProfile.StorageProfile.DataDisks = existing.VirtualMachineScaleSetProperties.VirtualMachineProfile.StorageProfile.DataDisks diff --git a/internal/services/containers/client/client.go b/internal/services/containers/client/client.go index 147249a81bcf..b051c60ece3a 100644 --- a/internal/services/containers/client/client.go +++ b/internal/services/containers/client/client.go @@ -1,8 +1,8 @@ package client import ( - legacy "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-08-01/containerservice" - "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" + legacy "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-08-01/containerservice" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/go-azure-sdk/resource-manager/containerinstance/2021-10-01/containerinstance" "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/agentpools" diff --git a/internal/services/containers/container_connected_registry_resource.go b/internal/services/containers/container_connected_registry_resource.go index 5a3742c2afdd..19d0a05fa969 100644 --- a/internal/services/containers/container_connected_registry_resource.go +++ b/internal/services/containers/container_connected_registry_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" + "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" tfvalidate "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" diff --git a/internal/services/containers/container_registry_agent_pool_resource.go b/internal/services/containers/container_registry_agent_pool_resource.go index 13b0f95d6c2a..562cca5faf6b 100644 --- a/internal/services/containers/container_registry_agent_pool_resource.go +++ b/internal/services/containers/container_registry_agent_pool_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" + "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/containers/container_registry_resource.go b/internal/services/containers/container_registry_resource.go index 0cb771bf4a73..9648f6ec8bf2 100644 --- a/internal/services/containers/container_registry_resource.go +++ b/internal/services/containers/container_registry_resource.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" + "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" @@ -642,13 +642,11 @@ func resourceContainerRegistryRead(d *pluginsdk.ResourceData, meta interface{}) return fmt.Errorf("making Read request on Azure Container Registry %s for replications: %s", id.Name, err) } - geoReplicationLocations := make([]interface{}, 0) geoReplications := make([]interface{}, 0) for _, value := range replications.Values() { if value.Location != nil { valueLocation := azure.NormalizeLocation(*value.Location) if location != nil && valueLocation != azure.NormalizeLocation(*location) { - geoReplicationLocations = append(geoReplicationLocations, *value.Location) replication := make(map[string]interface{}) replication["location"] = valueLocation replication["tags"] = tags.Flatten(value.Tags) diff --git a/internal/services/containers/container_registry_scope_map_resource.go b/internal/services/containers/container_registry_scope_map_resource.go index d3f521b292d1..4fc624b7bbb6 100644 --- a/internal/services/containers/container_registry_scope_map_resource.go +++ b/internal/services/containers/container_registry_scope_map_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" + "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/containers/container_registry_task_resource.go b/internal/services/containers/container_registry_task_resource.go index 2f6bf304d735..56c8df47a71c 100644 --- a/internal/services/containers/container_registry_task_resource.go +++ b/internal/services/containers/container_registry_task_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" + "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/internal/services/containers/container_registry_task_schedule_run_now_resource.go b/internal/services/containers/container_registry_task_schedule_run_now_resource.go index 39a5bce845ed..c455bc639567 100644 --- a/internal/services/containers/container_registry_task_schedule_run_now_resource.go +++ b/internal/services/containers/container_registry_task_schedule_run_now_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" + "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate" diff --git a/internal/services/containers/container_registry_token_data_source.go b/internal/services/containers/container_registry_token_data_source.go index faad60026da5..a8a677b151f9 100644 --- a/internal/services/containers/container_registry_token_data_source.go +++ b/internal/services/containers/container_registry_token_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" + "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/parse" diff --git a/internal/services/containers/container_registry_token_password_resource.go b/internal/services/containers/container_registry_token_password_resource.go index 081873aa269d..923085da7feb 100644 --- a/internal/services/containers/container_registry_token_password_resource.go +++ b/internal/services/containers/container_registry_token_password_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" + "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" diff --git a/internal/services/containers/container_registry_token_resource.go b/internal/services/containers/container_registry_token_resource.go index 083b83fbe2d6..748bf843d4e4 100644 --- a/internal/services/containers/container_registry_token_resource.go +++ b/internal/services/containers/container_registry_token_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" + "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/containers/container_registry_webhook_resource.go b/internal/services/containers/container_registry_webhook_resource.go index ff1376d1a6e3..020a78a248fa 100644 --- a/internal/services/containers/container_registry_webhook_resource.go +++ b/internal/services/containers/container_registry_webhook_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" + "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/containers/kubernetes_cluster_data_source.go b/internal/services/containers/kubernetes_cluster_data_source.go index f65e0eadaed1..48050846d3af 100644 --- a/internal/services/containers/kubernetes_cluster_data_source.go +++ b/internal/services/containers/kubernetes_cluster_data_source.go @@ -801,7 +801,7 @@ func flattenKubernetesClusterDataSourceAccessProfile(profile managedclusters.Man if kubeConfigRaw := profile.Properties.KubeConfig; kubeConfigRaw != nil { rawConfig := *kubeConfigRaw if base64IsEncoded(*kubeConfigRaw) { - rawConfig, _ = base64Decode(*kubeConfigRaw) + rawConfig = base64Decode(*kubeConfigRaw) } var flattenedKubeConfig []interface{} diff --git a/internal/services/containers/kubernetes_cluster_resource.go b/internal/services/containers/kubernetes_cluster_resource.go index 98cedb531c3c..5470c7524b15 100644 --- a/internal/services/containers/kubernetes_cluster_resource.go +++ b/internal/services/containers/kubernetes_cluster_resource.go @@ -1212,7 +1212,7 @@ func resourceKubernetesClusterCreate(d *pluginsdk.ResourceData, meta interface{} if v, ok := d.GetOk("workload_identity_enabled"); ok { workloadIdentity = v.(bool) - if workloadIdentity == true && enableOidcIssuer == false { + if workloadIdentity { return fmt.Errorf("`oidc_issuer_enabled` must be set to `true` to enable Azure AD Workload Identity") } @@ -2147,7 +2147,7 @@ func flattenKubernetesClusterAccessProfile(profile managedclusters.ManagedCluste if kubeConfigRaw := accessProfile.KubeConfig; kubeConfigRaw != nil { rawConfig := *kubeConfigRaw if base64IsEncoded(*kubeConfigRaw) { - rawConfig, _ = base64Decode(*kubeConfigRaw) + rawConfig = base64Decode(*kubeConfigRaw) } var flattenedKubeConfig []interface{} @@ -3336,12 +3336,12 @@ func flattenEdgeZone(input *edgezones.Model) string { return edgezones.NormalizeNilable(&input.Name) } -func base64Decode(str string) (string, bool) { +func base64Decode(str string) string { data, err := base64.StdEncoding.DecodeString(str) if err != nil { - return "", true + return "" } - return string(data), false + return string(data) } func base64IsEncoded(data string) bool { diff --git a/internal/services/cosmos/client/client.go b/internal/services/cosmos/client/client.go index 7496eadd0079..12f3bb51732f 100644 --- a/internal/services/cosmos/client/client.go +++ b/internal/services/cosmos/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-05-15/managedcassandras" "github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-05-15/sqldedicatedgateway" "github.com/hashicorp/terraform-provider-azurerm/internal/common" diff --git a/internal/services/cosmos/common/autoscale_settings.go b/internal/services/cosmos/common/autoscale_settings.go index c8e3644b21bb..bf6f31712702 100644 --- a/internal/services/cosmos/common/autoscale_settings.go +++ b/internal/services/cosmos/common/autoscale_settings.go @@ -3,7 +3,7 @@ package common import ( "log" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/cosmos/common/conflict_resolution_policy.go b/internal/services/cosmos/common/conflict_resolution_policy.go index d6fc4f580982..8e1191a4d8d6 100644 --- a/internal/services/cosmos/common/conflict_resolution_policy.go +++ b/internal/services/cosmos/common/conflict_resolution_policy.go @@ -1,7 +1,7 @@ package common import ( - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/cosmos/common/cors_rule.go b/internal/services/cosmos/common/cors_rule.go index caba3497c791..af3315cccc54 100644 --- a/internal/services/cosmos/common/cors_rule.go +++ b/internal/services/cosmos/common/cors_rule.go @@ -3,7 +3,7 @@ package common import ( "strings" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cosmos/common/indexing_policy.go b/internal/services/cosmos/common/indexing_policy.go index 3f480bab0fca..4d87afb83118 100644 --- a/internal/services/cosmos/common/indexing_policy.go +++ b/internal/services/cosmos/common/indexing_policy.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/cosmos/common/indexing_policy_test.go b/internal/services/cosmos/common/indexing_policy_test.go index 177d2628b3af..b2c740d8062c 100644 --- a/internal/services/cosmos/common/indexing_policy_test.go +++ b/internal/services/cosmos/common/indexing_policy_test.go @@ -3,7 +3,7 @@ package common import ( "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/cosmos/common/ip_rules.go b/internal/services/cosmos/common/ip_rules.go index 23711182127b..e238091ecf66 100644 --- a/internal/services/cosmos/common/ip_rules.go +++ b/internal/services/cosmos/common/ip_rules.go @@ -3,7 +3,7 @@ package common import ( "strings" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/cosmos/common/ip_rules_test.go b/internal/services/cosmos/common/ip_rules_test.go index e7a2268de19d..9e13013f1203 100644 --- a/internal/services/cosmos/common/ip_rules_test.go +++ b/internal/services/cosmos/common/ip_rules_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck ) var ( diff --git a/internal/services/cosmos/common/schema.go b/internal/services/cosmos/common/schema.go index b417cdd7ef3d..532f4a87bc0e 100644 --- a/internal/services/cosmos/common/schema.go +++ b/internal/services/cosmos/common/schema.go @@ -1,7 +1,7 @@ package common import ( - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/services/cosmos/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress" @@ -74,7 +74,7 @@ func CassandraTableSchemaPropertySchema() *pluginsdk.Schema { } func DatabaseAutoscaleSettingsSchema() *pluginsdk.Schema { - //lintignore:XS003 + // lintignore:XS003 return &pluginsdk.Schema{ Type: pluginsdk.TypeList, Optional: true, diff --git a/internal/services/cosmos/common/throughput.go b/internal/services/cosmos/common/throughput.go index 3d6082fd1545..a07f0e284dd4 100644 --- a/internal/services/cosmos/common/throughput.go +++ b/internal/services/cosmos/common/throughput.go @@ -3,7 +3,7 @@ package common import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/cosmos/cosmosdb_account_data_source.go b/internal/services/cosmos/cosmosdb_account_data_source.go index c0482f713b04..cc1a9b58da20 100644 --- a/internal/services/cosmos/cosmosdb_account_data_source.go +++ b/internal/services/cosmos/cosmosdb_account_data_source.go @@ -6,7 +6,7 @@ import ( "sort" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/cosmos/cosmosdb_account_data_source_test.go b/internal/services/cosmos/cosmosdb_account_data_source_test.go index 005cc1bf27dc..9cdb1e50c403 100644 --- a/internal/services/cosmos/cosmosdb_account_data_source_test.go +++ b/internal/services/cosmos/cosmosdb_account_data_source_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" ) diff --git a/internal/services/cosmos/cosmosdb_account_resource.go b/internal/services/cosmos/cosmosdb_account_resource.go index a4ab65373f8d..a11a34166b5d 100644 --- a/internal/services/cosmos/cosmosdb_account_resource.go +++ b/internal/services/cosmos/cosmosdb_account_resource.go @@ -10,7 +10,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/internal/services/cosmos/cosmosdb_account_resource_test.go b/internal/services/cosmos/cosmosdb_account_resource_test.go index 9ba80c22aac7..56f7803d749a 100644 --- a/internal/services/cosmos/cosmosdb_account_resource_test.go +++ b/internal/services/cosmos/cosmosdb_account_resource_test.go @@ -7,7 +7,7 @@ import ( "strconv" "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" @@ -176,6 +176,7 @@ func TestAccCosmosDBAccount_updateDefaultIdentity(t *testing.T) { }) } +//nolint:unparam func testAccCosmosDBAccount_basicWith(t *testing.T, kind documentdb.DatabaseAccountKind, consistency documentdb.DefaultConsistencyLevel) { data := acceptance.BuildTestData(t, "azurerm_cosmosdb_account", "test") r := CosmosDBAccountResource{} diff --git a/internal/services/cosmos/cosmosdb_cassandra_datacenter_resource.go b/internal/services/cosmos/cosmosdb_cassandra_datacenter_resource.go index e2cc64b701d7..aa69537014ea 100644 --- a/internal/services/cosmos/cosmosdb_cassandra_datacenter_resource.go +++ b/internal/services/cosmos/cosmosdb_cassandra_datacenter_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/cosmos/cosmosdb_cassandra_keyspace_resource.go b/internal/services/cosmos/cosmosdb_cassandra_keyspace_resource.go index 37f30f5e96ab..096f31ab37bf 100644 --- a/internal/services/cosmos/cosmosdb_cassandra_keyspace_resource.go +++ b/internal/services/cosmos/cosmosdb_cassandra_keyspace_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/cosmos/cosmosdb_cassandra_keyspace_resource_test.go b/internal/services/cosmos/cosmosdb_cassandra_keyspace_resource_test.go index 4f104beecc36..dd6b2cc3f6ce 100644 --- a/internal/services/cosmos/cosmosdb_cassandra_keyspace_resource_test.go +++ b/internal/services/cosmos/cosmosdb_cassandra_keyspace_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/cosmos/cosmosdb_cassandra_table_resource.go b/internal/services/cosmos/cosmosdb_cassandra_table_resource.go index a6512e8eb18e..f45428032469 100644 --- a/internal/services/cosmos/cosmosdb_cassandra_table_resource.go +++ b/internal/services/cosmos/cosmosdb_cassandra_table_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/cosmos/cosmosdb_gremlin_database_resource.go b/internal/services/cosmos/cosmosdb_gremlin_database_resource.go index 393b9e0d3873..64d896885423 100644 --- a/internal/services/cosmos/cosmosdb_gremlin_database_resource.go +++ b/internal/services/cosmos/cosmosdb_gremlin_database_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/cosmos/cosmosdb_gremlin_database_resource_test.go b/internal/services/cosmos/cosmosdb_gremlin_database_resource_test.go index 67f66f39b314..b2de1a94f2be 100644 --- a/internal/services/cosmos/cosmosdb_gremlin_database_resource_test.go +++ b/internal/services/cosmos/cosmosdb_gremlin_database_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/cosmos/cosmosdb_gremlin_graph_resource.go b/internal/services/cosmos/cosmosdb_gremlin_graph_resource.go index c4c3b31291ea..2eb128da97eb 100644 --- a/internal/services/cosmos/cosmosdb_gremlin_graph_resource.go +++ b/internal/services/cosmos/cosmosdb_gremlin_graph_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/cosmos/cosmosdb_mongo_collection_resource.go b/internal/services/cosmos/cosmosdb_mongo_collection_resource.go index c167bb959556..d3f1eff47819 100644 --- a/internal/services/cosmos/cosmosdb_mongo_collection_resource.go +++ b/internal/services/cosmos/cosmosdb_mongo_collection_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/cosmos/cosmosdb_mongo_collection_resource_test.go b/internal/services/cosmos/cosmosdb_mongo_collection_resource_test.go index e2d9a1bdd9f8..f8ff22635c06 100644 --- a/internal/services/cosmos/cosmosdb_mongo_collection_resource_test.go +++ b/internal/services/cosmos/cosmosdb_mongo_collection_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/cosmos/cosmosdb_mongo_database_resource.go b/internal/services/cosmos/cosmosdb_mongo_database_resource.go index 57cafb17133f..0f39cf43ffbd 100644 --- a/internal/services/cosmos/cosmosdb_mongo_database_resource.go +++ b/internal/services/cosmos/cosmosdb_mongo_database_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/cosmos/cosmosdb_mongo_database_resource_test.go b/internal/services/cosmos/cosmosdb_mongo_database_resource_test.go index 9023b1884120..f434b723b856 100644 --- a/internal/services/cosmos/cosmosdb_mongo_database_resource_test.go +++ b/internal/services/cosmos/cosmosdb_mongo_database_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/cosmos/cosmosdb_notebook_workspace_resource.go b/internal/services/cosmos/cosmosdb_notebook_workspace_resource.go index 290ced46fd1f..4b4654cf4394 100644 --- a/internal/services/cosmos/cosmosdb_notebook_workspace_resource.go +++ b/internal/services/cosmos/cosmosdb_notebook_workspace_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/cosmos/cosmosdb_notebook_workspace_resource_test.go b/internal/services/cosmos/cosmosdb_notebook_workspace_resource_test.go index 40158e78fff5..38aded285531 100644 --- a/internal/services/cosmos/cosmosdb_notebook_workspace_resource_test.go +++ b/internal/services/cosmos/cosmosdb_notebook_workspace_resource_test.go @@ -60,6 +60,7 @@ func (r CosmosDbNotebookWorkspaceResource) Exists(ctx context.Context, client *c return utils.Bool(true), nil } +//nolint:unused func (r CosmosDbNotebookWorkspaceResource) template(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { @@ -90,6 +91,7 @@ resource "azurerm_cosmosdb_account" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomInteger) } +//nolint:unused func (r CosmosDbNotebookWorkspaceResource) basic(data acceptance.TestData) string { template := r.template(data) return fmt.Sprintf(` @@ -103,6 +105,7 @@ resource "azurerm_cosmosdb_notebook_workspace" "test" { `, template) } +//nolint:unused func (r CosmosDbNotebookWorkspaceResource) requiresImport(data acceptance.TestData) string { config := r.basic(data) return fmt.Sprintf(` diff --git a/internal/services/cosmos/cosmosdb_restorable_database_accounts_data_source.go b/internal/services/cosmos/cosmosdb_restorable_database_accounts_data_source.go index 2d0277feb898..251d441ea2fa 100644 --- a/internal/services/cosmos/cosmosdb_restorable_database_accounts_data_source.go +++ b/internal/services/cosmos/cosmosdb_restorable_database_accounts_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/cosmos/parse" diff --git a/internal/services/cosmos/cosmosdb_sql_container_resource.go b/internal/services/cosmos/cosmosdb_sql_container_resource.go index ffa771e25162..4f6d32353823 100644 --- a/internal/services/cosmos/cosmosdb_sql_container_resource.go +++ b/internal/services/cosmos/cosmosdb_sql_container_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/cosmos/cosmosdb_sql_container_resource_test.go b/internal/services/cosmos/cosmosdb_sql_container_resource_test.go index 3b5aa92fe6b7..8f31918b876e 100644 --- a/internal/services/cosmos/cosmosdb_sql_container_resource_test.go +++ b/internal/services/cosmos/cosmosdb_sql_container_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/cosmos/cosmosdb_sql_database_resource.go b/internal/services/cosmos/cosmosdb_sql_database_resource.go index 821bb1244e3b..05d6facb543f 100644 --- a/internal/services/cosmos/cosmosdb_sql_database_resource.go +++ b/internal/services/cosmos/cosmosdb_sql_database_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/cosmos/cosmosdb_sql_database_resource_test.go b/internal/services/cosmos/cosmosdb_sql_database_resource_test.go index 6174d7f0d300..5eb215d82abf 100644 --- a/internal/services/cosmos/cosmosdb_sql_database_resource_test.go +++ b/internal/services/cosmos/cosmosdb_sql_database_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/cosmos/cosmosdb_sql_function_resource.go b/internal/services/cosmos/cosmosdb_sql_function_resource.go index 2230cfd267cc..2bdf51e66caa 100644 --- a/internal/services/cosmos/cosmosdb_sql_function_resource.go +++ b/internal/services/cosmos/cosmosdb_sql_function_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/cosmos/parse" diff --git a/internal/services/cosmos/cosmosdb_sql_function_resource_test.go b/internal/services/cosmos/cosmosdb_sql_function_resource_test.go index f0add3eb47d2..5131f231a3f5 100644 --- a/internal/services/cosmos/cosmosdb_sql_function_resource_test.go +++ b/internal/services/cosmos/cosmosdb_sql_function_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/cosmos/cosmosdb_sql_role_assignment_resource.go b/internal/services/cosmos/cosmosdb_sql_role_assignment_resource.go index e6b4e65609af..f07dc15f5244 100644 --- a/internal/services/cosmos/cosmosdb_sql_role_assignment_resource.go +++ b/internal/services/cosmos/cosmosdb_sql_role_assignment_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/cosmos/cosmosdb_sql_role_definition_resource.go b/internal/services/cosmos/cosmosdb_sql_role_definition_resource.go index 68b330af40de..3c9620f885c6 100644 --- a/internal/services/cosmos/cosmosdb_sql_role_definition_resource.go +++ b/internal/services/cosmos/cosmosdb_sql_role_definition_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/cosmos/cosmosdb_sql_stored_procedure_resource.go b/internal/services/cosmos/cosmosdb_sql_stored_procedure_resource.go index 5c88f3a47b43..956d22dbd733 100644 --- a/internal/services/cosmos/cosmosdb_sql_stored_procedure_resource.go +++ b/internal/services/cosmos/cosmosdb_sql_stored_procedure_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/cosmos/cosmosdb_sql_stored_procedure_resource_test.go b/internal/services/cosmos/cosmosdb_sql_stored_procedure_resource_test.go index 79af9aafd7d6..1b4409aac1a4 100644 --- a/internal/services/cosmos/cosmosdb_sql_stored_procedure_resource_test.go +++ b/internal/services/cosmos/cosmosdb_sql_stored_procedure_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/cosmos/cosmosdb_sql_trigger_resource.go b/internal/services/cosmos/cosmosdb_sql_trigger_resource.go index 2e65ec7a4560..de66ec5e3292 100644 --- a/internal/services/cosmos/cosmosdb_sql_trigger_resource.go +++ b/internal/services/cosmos/cosmosdb_sql_trigger_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/cosmos/parse" diff --git a/internal/services/cosmos/cosmosdb_sql_trigger_resource_test.go b/internal/services/cosmos/cosmosdb_sql_trigger_resource_test.go index 03aafe7fb2aa..3e0c4ad27952 100644 --- a/internal/services/cosmos/cosmosdb_sql_trigger_resource_test.go +++ b/internal/services/cosmos/cosmosdb_sql_trigger_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/cosmos/cosmosdb_table_resource.go b/internal/services/cosmos/cosmosdb_table_resource.go index 1530ef920dee..8b5bc5a893c4 100644 --- a/internal/services/cosmos/cosmosdb_table_resource.go +++ b/internal/services/cosmos/cosmosdb_table_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/cosmos/cosmosdb_table_resource_test.go b/internal/services/cosmos/cosmosdb_table_resource_test.go index 1599149fc7fd..1708faa04cc0 100644 --- a/internal/services/cosmos/cosmosdb_table_resource_test.go +++ b/internal/services/cosmos/cosmosdb_table_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" + "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/customproviders/custom_provider_resource.go b/internal/services/customproviders/custom_provider_resource.go index 5a481b582fcc..2406fd8900f3 100644 --- a/internal/services/customproviders/custom_provider_resource.go +++ b/internal/services/customproviders/custom_provider_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/customproviders/mgmt/2018-09-01-preview/customproviders" + "github.com/Azure/azure-sdk-for-go/services/preview/customproviders/mgmt/2018-09-01-preview/customproviders" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" diff --git a/internal/services/dashboard/dashboard_grafana_resource.go b/internal/services/dashboard/dashboard_grafana_resource.go index dc3f8ab9dbeb..592acceab246 100644 --- a/internal/services/dashboard/dashboard_grafana_resource.go +++ b/internal/services/dashboard/dashboard_grafana_resource.go @@ -158,10 +158,7 @@ func (r DashboardGrafanaResource) Create() sdk.ResourceFunc { return metadata.ResourceRequiresImport(r.ResourceType(), id) } - identityValue, err := expandLegacySystemAndUserAssignedMap(metadata.ResourceData.Get("identity").([]interface{})) - if err != nil { - return fmt.Errorf("expanding `identity`: %+v", err) - } + identityValue := expandLegacySystemAndUserAssignedMap(metadata.ResourceData.Get("identity").([]interface{})) apiKey := grafanaresource.ApiKeyDisabled if model.ApiKeyEnabled { @@ -312,10 +309,7 @@ func (r DashboardGrafanaResource) Read() sdk.ResourceFunc { Location: location.NormalizeNilable(model.Location), } - identityValue, err := flattenLegacySystemAndUserAssignedMap(model.Identity) - if err != nil { - return fmt.Errorf("flattening `identity`: %+v", err) - } + identityValue := flattenLegacySystemAndUserAssignedMap(model.Identity) if err := metadata.ResourceData.Set("identity", identityValue); err != nil { return fmt.Errorf("setting `identity`: %+v", err) @@ -404,20 +398,20 @@ func (r DashboardGrafanaResource) Delete() sdk.ResourceFunc { } } -func expandLegacySystemAndUserAssignedMap(input []interface{}) (*identity.LegacySystemAndUserAssignedMap, error) { +func expandLegacySystemAndUserAssignedMap(input []interface{}) *identity.LegacySystemAndUserAssignedMap { identityValue, err := identity.ExpandSystemAssigned(input) if err != nil { - return nil, err + return nil } return &identity.LegacySystemAndUserAssignedMap{ Type: identityValue.Type, - }, nil + } } -func flattenLegacySystemAndUserAssignedMap(input *identity.LegacySystemAndUserAssignedMap) (*[]interface{}, error) { +func flattenLegacySystemAndUserAssignedMap(input *identity.LegacySystemAndUserAssignedMap) *[]interface{} { if input == nil { - return &[]interface{}{}, nil + return &[]interface{}{} } identityValue := &identity.SystemAssigned{ @@ -427,5 +421,5 @@ func flattenLegacySystemAndUserAssignedMap(input *identity.LegacySystemAndUserAs } output := identity.FlattenSystemAssigned(identityValue) - return &output, nil + return &output } diff --git a/internal/services/databasemigration/client/client.go b/internal/services/databasemigration/client/client.go index 73f08a1f42f2..c6cc84cc4c2b 100644 --- a/internal/services/databasemigration/client/client.go +++ b/internal/services/databasemigration/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/datamigration/mgmt/2018-04-19/datamigration" + "github.com/Azure/azure-sdk-for-go/services/datamigration/mgmt/2018-04-19/datamigration" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/databasemigration/database_migration_project_resource.go b/internal/services/databasemigration/database_migration_project_resource.go index f3feb2148c4e..5c867b78243f 100644 --- a/internal/services/databasemigration/database_migration_project_resource.go +++ b/internal/services/databasemigration/database_migration_project_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datamigration/mgmt/2018-04-19/datamigration" + "github.com/Azure/azure-sdk-for-go/services/datamigration/mgmt/2018-04-19/datamigration" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/databasemigration/database_migration_service_resource.go b/internal/services/databasemigration/database_migration_service_resource.go index 79e344ce8f6b..dbcdcdc71ae7 100644 --- a/internal/services/databasemigration/database_migration_service_resource.go +++ b/internal/services/databasemigration/database_migration_service_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datamigration/mgmt/2018-04-19/datamigration" + "github.com/Azure/azure-sdk-for-go/services/datamigration/mgmt/2018-04-19/datamigration" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/databoxedge/client/client.go b/internal/services/databoxedge/client/client.go index 110ca6f49a9a..a4c5018a2b5b 100644 --- a/internal/services/databoxedge/client/client.go +++ b/internal/services/databoxedge/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2020-12-01/databoxedge" + "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2020-12-01/databoxedge" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/databoxedge/databox_edge_device_resource.go b/internal/services/databoxedge/databox_edge_device_resource.go index 78c045fcebe4..2c2d200518b4 100644 --- a/internal/services/databoxedge/databox_edge_device_resource.go +++ b/internal/services/databoxedge/databox_edge_device_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2020-12-01/databoxedge" + "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2020-12-01/databoxedge" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/databoxedge/databox_edge_order_resource.go b/internal/services/databoxedge/databox_edge_order_resource.go index f308b8b2eb70..c76c5dd4413f 100644 --- a/internal/services/databoxedge/databox_edge_order_resource.go +++ b/internal/services/databoxedge/databox_edge_order_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2020-12-01/databoxedge" + "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2020-12-01/databoxedge" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/databoxedge/parse/databox_edge_device_sku.go b/internal/services/databoxedge/parse/databox_edge_device_sku.go index f264b65fef2d..7c0d1bd1417b 100644 --- a/internal/services/databoxedge/parse/databox_edge_device_sku.go +++ b/internal/services/databoxedge/parse/databox_edge_device_sku.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2020-12-01/databoxedge" + "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2020-12-01/databoxedge" // nolint: staticcheck ) // DataboxEdgeDeviceSku type diff --git a/internal/services/databoxedge/validate/databox_edge_device_sku_name.go b/internal/services/databoxedge/validate/databox_edge_device_sku_name.go index 774f6f6c0e1a..def67601b364 100644 --- a/internal/services/databoxedge/validate/databox_edge_device_sku_name.go +++ b/internal/services/databoxedge/validate/databox_edge_device_sku_name.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2020-12-01/databoxedge" + "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2020-12-01/databoxedge" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" ) diff --git a/internal/services/databricks/validate/access_connector_name_test.go b/internal/services/databricks/validate/access_connector_name_test.go index 21aa09333c24..f9397b704305 100644 --- a/internal/services/databricks/validate/access_connector_name_test.go +++ b/internal/services/databricks/validate/access_connector_name_test.go @@ -7,7 +7,6 @@ import ( func TestAccessConnectorName(t *testing.T) { const errEmpty = "cannot be an empty string" - const errMinLen = "must be at least 1 character" const errMaxLen = "must be no more than 30 characters" const errAllowList = "can contain only alphanumeric characters, underscores, and hyphens" diff --git a/internal/services/datadog/azurerm_datadog_monitor_sso_configuration.go b/internal/services/datadog/azurerm_datadog_monitor_sso_configuration.go index 3a23f622fa08..ef403f71b2ed 100644 --- a/internal/services/datadog/azurerm_datadog_monitor_sso_configuration.go +++ b/internal/services/datadog/azurerm_datadog_monitor_sso_configuration.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datadog/mgmt/2021-03-01/datadog" + "github.com/Azure/azure-sdk-for-go/services/datadog/mgmt/2021-03-01/datadog" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datadog/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datadog/validate" diff --git a/internal/services/datadog/client/client.go b/internal/services/datadog/client/client.go index c76348862ede..9e804afd17a7 100644 --- a/internal/services/datadog/client/client.go +++ b/internal/services/datadog/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/datadog/mgmt/2021-03-01/datadog" + "github.com/Azure/azure-sdk-for-go/services/datadog/mgmt/2021-03-01/datadog" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/datadog/datadog_monitor_tag_rule_resource.go b/internal/services/datadog/datadog_monitor_tag_rule_resource.go index 205b39519d92..64e952623ff4 100644 --- a/internal/services/datadog/datadog_monitor_tag_rule_resource.go +++ b/internal/services/datadog/datadog_monitor_tag_rule_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datadog/mgmt/2021-03-01/datadog" + "github.com/Azure/azure-sdk-for-go/services/datadog/mgmt/2021-03-01/datadog" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datadog/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datadog/validate" diff --git a/internal/services/datadog/datadog_monitor_tag_rule_resource_test.go b/internal/services/datadog/datadog_monitor_tag_rule_resource_test.go index fdbaff062fa2..7858b95fe7a6 100644 --- a/internal/services/datadog/datadog_monitor_tag_rule_resource_test.go +++ b/internal/services/datadog/datadog_monitor_tag_rule_resource_test.go @@ -77,7 +77,7 @@ func (r TagRulesDatadogMonitorResource) Exists(ctx context.Context, client *clie return nil, fmt.Errorf("retrieving Datadog Monitor %q (Resource Group %q): %+v", id.MonitorName, id.ResourceGroup, err) } - if (*resp.Properties.LogRules.SendResourceLogs == false && *resp.Properties.LogRules.SendSubscriptionLogs == false) || *resp.Properties.MetricRules.FilteringTags == nil { + if (!*resp.Properties.LogRules.SendResourceLogs && !*resp.Properties.LogRules.SendSubscriptionLogs) || *resp.Properties.MetricRules.FilteringTags == nil { return utils.Bool(false), nil } diff --git a/internal/services/datadog/datadog_monitors_resource.go b/internal/services/datadog/datadog_monitors_resource.go index 219e80ba19c5..18c4ea605847 100644 --- a/internal/services/datadog/datadog_monitors_resource.go +++ b/internal/services/datadog/datadog_monitors_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datadog/mgmt/2021-03-01/datadog" + "github.com/Azure/azure-sdk-for-go/services/datadog/mgmt/2021-03-01/datadog" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/datafactory/client/client.go b/internal/services/datafactory/client/client.go index 5393bff79223..3d3e01abe1a6 100644 --- a/internal/services/datafactory/client/client.go +++ b/internal/services/datafactory/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/datafactory/data_factory.go b/internal/services/datafactory/data_factory.go index a6896932adbb..4a441c6a8955 100644 --- a/internal/services/datafactory/data_factory.go +++ b/internal/services/datafactory/data_factory.go @@ -7,7 +7,7 @@ import ( "sort" "strings" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/datafactory/data_factory_custom_dataset_resource.go b/internal/services/datafactory/data_factory_custom_dataset_resource.go index 5f3a3040da36..743d3d00af08 100644 --- a/internal/services/datafactory/data_factory_custom_dataset_resource.go +++ b/internal/services/datafactory/data_factory_custom_dataset_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_data_flow.go b/internal/services/datafactory/data_factory_data_flow.go index f1fcd78ecc5d..ade700d54b9c 100644 --- a/internal/services/datafactory/data_factory_data_flow.go +++ b/internal/services/datafactory/data_factory_data_flow.go @@ -1,7 +1,7 @@ package datafactory import ( - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/datafactory/data_factory_data_flow_resource.go b/internal/services/datafactory/data_factory_data_flow_resource.go index b3ffac5500da..0f79b6bc1763 100644 --- a/internal/services/datafactory/data_factory_data_flow_resource.go +++ b/internal/services/datafactory/data_factory_data_flow_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_data_source.go b/internal/services/datafactory/data_factory_data_source.go index abfd651ed9b5..133fc99507dc 100644 --- a/internal/services/datafactory/data_factory_data_source.go +++ b/internal/services/datafactory/data_factory_data_source.go @@ -5,7 +5,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/datafactory/data_factory_dataset_azure_blob_resource.go b/internal/services/datafactory/data_factory_dataset_azure_blob_resource.go index 127dd4db772b..407409108cb7 100644 --- a/internal/services/datafactory/data_factory_dataset_azure_blob_resource.go +++ b/internal/services/datafactory/data_factory_dataset_azure_blob_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_dataset_binary_resource.go b/internal/services/datafactory/data_factory_dataset_binary_resource.go index f888d708ad0f..e02d39abb05e 100644 --- a/internal/services/datafactory/data_factory_dataset_binary_resource.go +++ b/internal/services/datafactory/data_factory_dataset_binary_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_dataset_cosmosdb_sqlapi_resource.go b/internal/services/datafactory/data_factory_dataset_cosmosdb_sqlapi_resource.go index 9723592805bf..f49911486113 100644 --- a/internal/services/datafactory/data_factory_dataset_cosmosdb_sqlapi_resource.go +++ b/internal/services/datafactory/data_factory_dataset_cosmosdb_sqlapi_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_dataset_delimited_text_resource.go b/internal/services/datafactory/data_factory_dataset_delimited_text_resource.go index fa934ffe0a7f..98491a2c4af1 100644 --- a/internal/services/datafactory/data_factory_dataset_delimited_text_resource.go +++ b/internal/services/datafactory/data_factory_dataset_delimited_text_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_dataset_http_resource.go b/internal/services/datafactory/data_factory_dataset_http_resource.go index 623184f2dc92..f3a8bccc823c 100644 --- a/internal/services/datafactory/data_factory_dataset_http_resource.go +++ b/internal/services/datafactory/data_factory_dataset_http_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_dataset_json_resource.go b/internal/services/datafactory/data_factory_dataset_json_resource.go index a03a4c2994a2..336997da29a3 100644 --- a/internal/services/datafactory/data_factory_dataset_json_resource.go +++ b/internal/services/datafactory/data_factory_dataset_json_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_dataset_mysql_resource.go b/internal/services/datafactory/data_factory_dataset_mysql_resource.go index 5e55890dc9be..5ec403827432 100644 --- a/internal/services/datafactory/data_factory_dataset_mysql_resource.go +++ b/internal/services/datafactory/data_factory_dataset_mysql_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_dataset_parquet_resource.go b/internal/services/datafactory/data_factory_dataset_parquet_resource.go index cb736b146366..561166121e88 100644 --- a/internal/services/datafactory/data_factory_dataset_parquet_resource.go +++ b/internal/services/datafactory/data_factory_dataset_parquet_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_dataset_postgresql_resource.go b/internal/services/datafactory/data_factory_dataset_postgresql_resource.go index f83d5ac2d0c8..e02fcf7b5b38 100644 --- a/internal/services/datafactory/data_factory_dataset_postgresql_resource.go +++ b/internal/services/datafactory/data_factory_dataset_postgresql_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_dataset_snowflake_resource.go b/internal/services/datafactory/data_factory_dataset_snowflake_resource.go index 3641c876e916..78ca07ee227a 100644 --- a/internal/services/datafactory/data_factory_dataset_snowflake_resource.go +++ b/internal/services/datafactory/data_factory_dataset_snowflake_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_dataset_sql_server_table_resource.go b/internal/services/datafactory/data_factory_dataset_sql_server_table_resource.go index 3389e48adf59..b5a7424c3768 100644 --- a/internal/services/datafactory/data_factory_dataset_sql_server_table_resource.go +++ b/internal/services/datafactory/data_factory_dataset_sql_server_table_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_flowlet_data_flow_resource.go b/internal/services/datafactory/data_factory_flowlet_data_flow_resource.go index 1c53b51cd1f7..647ed15b7155 100644 --- a/internal/services/datafactory/data_factory_flowlet_data_flow_resource.go +++ b/internal/services/datafactory/data_factory_flowlet_data_flow_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_integration_runtime_azure_resource.go b/internal/services/datafactory/data_factory_integration_runtime_azure_resource.go index bf2d474974ce..0c62203398ce 100644 --- a/internal/services/datafactory/data_factory_integration_runtime_azure_resource.go +++ b/internal/services/datafactory/data_factory_integration_runtime_azure_resource.go @@ -5,7 +5,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/datafactory/data_factory_integration_runtime_azure_ssis_resource.go b/internal/services/datafactory/data_factory_integration_runtime_azure_ssis_resource.go index c26e3b6d8a1e..0f50c85f1c24 100644 --- a/internal/services/datafactory/data_factory_integration_runtime_azure_ssis_resource.go +++ b/internal/services/datafactory/data_factory_integration_runtime_azure_ssis_resource.go @@ -5,7 +5,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/datafactory/data_factory_integration_runtime_managed_resource.go b/internal/services/datafactory/data_factory_integration_runtime_managed_resource.go index 07fea91f0f91..4512dcb968f5 100644 --- a/internal/services/datafactory/data_factory_integration_runtime_managed_resource.go +++ b/internal/services/datafactory/data_factory_integration_runtime_managed_resource.go @@ -5,7 +5,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/datafactory/data_factory_integration_runtime_self_hosted_resource.go b/internal/services/datafactory/data_factory_integration_runtime_self_hosted_resource.go index 77c8321818e9..a0eada77288b 100644 --- a/internal/services/datafactory/data_factory_integration_runtime_self_hosted_resource.go +++ b/internal/services/datafactory/data_factory_integration_runtime_self_hosted_resource.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_custom_service_resource.go b/internal/services/datafactory/data_factory_linked_custom_service_resource.go index 94ce24e3ead6..a3a6c1f61dbb 100644 --- a/internal/services/datafactory/data_factory_linked_custom_service_resource.go +++ b/internal/services/datafactory/data_factory_linked_custom_service_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service.go b/internal/services/datafactory/data_factory_linked_service.go index 07bdc89498b1..3eba246b744b 100644 --- a/internal/services/datafactory/data_factory_linked_service.go +++ b/internal/services/datafactory/data_factory_linked_service.go @@ -5,7 +5,7 @@ import ( "encoding/json" "fmt" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/datafactory/data_factory_linked_service_azure_blob_storage_resource.go b/internal/services/datafactory/data_factory_linked_service_azure_blob_storage_resource.go index 389c7cc5cf68..c56e22731d57 100644 --- a/internal/services/datafactory/data_factory_linked_service_azure_blob_storage_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_azure_blob_storage_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_azure_databricks_resource.go b/internal/services/datafactory/data_factory_linked_service_azure_databricks_resource.go index a9ee2f2cd396..b1e0326aae3b 100644 --- a/internal/services/datafactory/data_factory_linked_service_azure_databricks_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_azure_databricks_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/go-azure-sdk/resource-manager/databricks/2022-04-01-preview/workspaces" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/datafactory/data_factory_linked_service_azure_file_storage_resource.go b/internal/services/datafactory/data_factory_linked_service_azure_file_storage_resource.go index 2f2919371798..691acb8b4204 100644 --- a/internal/services/datafactory/data_factory_linked_service_azure_file_storage_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_azure_file_storage_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_azure_function_resource.go b/internal/services/datafactory/data_factory_linked_service_azure_function_resource.go index c6fb87a13478..20a9ecfb7ccc 100644 --- a/internal/services/datafactory/data_factory_linked_service_azure_function_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_azure_function_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_azure_search_resource.go b/internal/services/datafactory/data_factory_linked_service_azure_search_resource.go index 421ad9af8f5d..815869b3c06b 100644 --- a/internal/services/datafactory/data_factory_linked_service_azure_search_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_azure_search_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_azure_sql_database_resource.go b/internal/services/datafactory/data_factory_linked_service_azure_sql_database_resource.go index 4226caad2bb6..478cbd51657d 100644 --- a/internal/services/datafactory/data_factory_linked_service_azure_sql_database_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_azure_sql_database_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_azure_table_storage_resource.go b/internal/services/datafactory/data_factory_linked_service_azure_table_storage_resource.go index 0f6bc00bd3dc..ef52f1ec4ded 100644 --- a/internal/services/datafactory/data_factory_linked_service_azure_table_storage_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_azure_table_storage_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_cosmosdb_mongoapi_resource.go b/internal/services/datafactory/data_factory_linked_service_cosmosdb_mongoapi_resource.go index 859f5e823044..52706a19da06 100644 --- a/internal/services/datafactory/data_factory_linked_service_cosmosdb_mongoapi_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_cosmosdb_mongoapi_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_cosmosdb_resource.go b/internal/services/datafactory/data_factory_linked_service_cosmosdb_resource.go index b9cde424bace..67e1ff36d254 100644 --- a/internal/services/datafactory/data_factory_linked_service_cosmosdb_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_cosmosdb_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_data_lake_storage_gen2_resource.go b/internal/services/datafactory/data_factory_linked_service_data_lake_storage_gen2_resource.go index b32884c74667..ffc83aa63453 100644 --- a/internal/services/datafactory/data_factory_linked_service_data_lake_storage_gen2_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_data_lake_storage_gen2_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_key_vault_resource.go b/internal/services/datafactory/data_factory_linked_service_key_vault_resource.go index 4092c47fc7a5..1e6e47dd2b0b 100644 --- a/internal/services/datafactory/data_factory_linked_service_key_vault_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_key_vault_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/datafactory/data_factory_linked_service_kusto_resource.go b/internal/services/datafactory/data_factory_linked_service_kusto_resource.go index b9379bc6f363..ec1014cdee82 100644 --- a/internal/services/datafactory/data_factory_linked_service_kusto_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_kusto_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_mysql_resource.go b/internal/services/datafactory/data_factory_linked_service_mysql_resource.go index 808cc252bba1..cded8a80b30a 100644 --- a/internal/services/datafactory/data_factory_linked_service_mysql_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_mysql_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_odata_resource.go b/internal/services/datafactory/data_factory_linked_service_odata_resource.go index 7212bd91a955..e14e9e2d00b0 100644 --- a/internal/services/datafactory/data_factory_linked_service_odata_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_odata_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_odbc_resource.go b/internal/services/datafactory/data_factory_linked_service_odbc_resource.go index f9e73a671e87..5a8808800e47 100644 --- a/internal/services/datafactory/data_factory_linked_service_odbc_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_odbc_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_postgresql_resource.go b/internal/services/datafactory/data_factory_linked_service_postgresql_resource.go index 6d51dd6ba4e8..196128654609 100644 --- a/internal/services/datafactory/data_factory_linked_service_postgresql_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_postgresql_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_sftp_resource.go b/internal/services/datafactory/data_factory_linked_service_sftp_resource.go index 01d40ff74fdd..ad32a189bd15 100644 --- a/internal/services/datafactory/data_factory_linked_service_sftp_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_sftp_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_snowflake_resource.go b/internal/services/datafactory/data_factory_linked_service_snowflake_resource.go index 93e815f337b6..bdee05afe87c 100644 --- a/internal/services/datafactory/data_factory_linked_service_snowflake_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_snowflake_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_sql_server_resource.go b/internal/services/datafactory/data_factory_linked_service_sql_server_resource.go index 53fff388f185..e2ea8df78460 100644 --- a/internal/services/datafactory/data_factory_linked_service_sql_server_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_sql_server_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_synapse_resource.go b/internal/services/datafactory/data_factory_linked_service_synapse_resource.go index 398d04515d25..ee620500a5bb 100644 --- a/internal/services/datafactory/data_factory_linked_service_synapse_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_synapse_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_linked_service_web_resource.go b/internal/services/datafactory/data_factory_linked_service_web_resource.go index 5562eee51d27..ac6f5133bf34 100644 --- a/internal/services/datafactory/data_factory_linked_service_web_resource.go +++ b/internal/services/datafactory/data_factory_linked_service_web_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_managed_private_endpoint_resource.go b/internal/services/datafactory/data_factory_managed_private_endpoint_resource.go index 62f14b352784..23cc308d03b0 100644 --- a/internal/services/datafactory/data_factory_managed_private_endpoint_resource.go +++ b/internal/services/datafactory/data_factory_managed_private_endpoint_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/datafactory/data_factory_pipeline_resource.go b/internal/services/datafactory/data_factory_pipeline_resource.go index e029656f77f0..3b6e37a47da0 100644 --- a/internal/services/datafactory/data_factory_pipeline_resource.go +++ b/internal/services/datafactory/data_factory_pipeline_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_resource.go b/internal/services/datafactory/data_factory_resource.go index 50781c02c6e8..c9ee800b66c9 100644 --- a/internal/services/datafactory/data_factory_resource.go +++ b/internal/services/datafactory/data_factory_resource.go @@ -7,7 +7,7 @@ import ( "reflect" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/internal/services/datafactory/data_factory_trigger_blob_event_resource.go b/internal/services/datafactory/data_factory_trigger_blob_event_resource.go index b515e6167eae..ad9a59ef8950 100644 --- a/internal/services/datafactory/data_factory_trigger_blob_event_resource.go +++ b/internal/services/datafactory/data_factory_trigger_blob_event_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_trigger_custom_event_resource.go b/internal/services/datafactory/data_factory_trigger_custom_event_resource.go index a6fed0f44642..b618c43a95be 100644 --- a/internal/services/datafactory/data_factory_trigger_custom_event_resource.go +++ b/internal/services/datafactory/data_factory_trigger_custom_event_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" diff --git a/internal/services/datafactory/data_factory_trigger_schedule_resource.go b/internal/services/datafactory/data_factory_trigger_schedule_resource.go index 9732289e34ed..73f3b740f5a3 100644 --- a/internal/services/datafactory/data_factory_trigger_schedule_resource.go +++ b/internal/services/datafactory/data_factory_trigger_schedule_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/datafactory/data_factory_trigger_tumbling_window_resource.go b/internal/services/datafactory/data_factory_trigger_tumbling_window_resource.go index 4241b70b7834..d7e5a2ca6bb3 100644 --- a/internal/services/datafactory/data_factory_trigger_tumbling_window_resource.go +++ b/internal/services/datafactory/data_factory_trigger_tumbling_window_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/datafactory/migration/data_factory.go b/internal/services/datafactory/migration/data_factory.go index 5c22d14b8950..6f0bd8c73081 100644 --- a/internal/services/datafactory/migration/data_factory.go +++ b/internal/services/datafactory/migration/data_factory.go @@ -4,7 +4,7 @@ import ( "context" "log" - "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/services/datafactory/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" ) diff --git a/internal/services/dataprotection/data_protection_backup_policy_postgresql_resource.go b/internal/services/dataprotection/data_protection_backup_policy_postgresql_resource.go index 6e12c1a01146..1c4ae5003f36 100644 --- a/internal/services/dataprotection/data_protection_backup_policy_postgresql_resource.go +++ b/internal/services/dataprotection/data_protection_backup_policy_postgresql_resource.go @@ -551,9 +551,7 @@ func flattenBackupPolicyPostgreSQLBackupCriteriaArray(input *[]backuppolicies.Ba var scheduleTimes []string if criteria.ScheduleTimes != nil { scheduleTimes = make([]string, 0) - for _, item := range *criteria.ScheduleTimes { - scheduleTimes = append(scheduleTimes, item) - } + scheduleTimes = append(scheduleTimes, *criteria.ScheduleTimes...) } results = append(results, map[string]interface{}{ diff --git a/internal/services/datashare/client/client.go b/internal/services/datashare/client/client.go index 03a82968168d..d26ff118d02c 100644 --- a/internal/services/datashare/client/client.go +++ b/internal/services/datashare/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/datashare/data_share_account_resource.go b/internal/services/datashare/data_share_account_resource.go index e1b6c82daa5b..1949b5e83d91 100644 --- a/internal/services/datashare/data_share_account_resource.go +++ b/internal/services/datashare/data_share_account_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/datashare/data_share_data_source.go b/internal/services/datashare/data_share_data_source.go index f61fac67049f..7fda3102c6c3 100644 --- a/internal/services/datashare/data_share_data_source.go +++ b/internal/services/datashare/data_share_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datashare/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datashare/validate" diff --git a/internal/services/datashare/data_share_dataset_blob_storage_data_source.go b/internal/services/datashare/data_share_dataset_blob_storage_data_source.go index 4e897b94af10..317c89a56bbe 100644 --- a/internal/services/datashare/data_share_dataset_blob_storage_data_source.go +++ b/internal/services/datashare/data_share_dataset_blob_storage_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datashare/helper" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datashare/parse" diff --git a/internal/services/datashare/data_share_dataset_blob_storage_resource.go b/internal/services/datashare/data_share_dataset_blob_storage_resource.go index 211463c65c10..6865229baee8 100644 --- a/internal/services/datashare/data_share_dataset_blob_storage_resource.go +++ b/internal/services/datashare/data_share_dataset_blob_storage_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/datashare/data_share_dataset_blob_storage_resource_test.go b/internal/services/datashare/data_share_dataset_blob_storage_resource_test.go index dcd628f365be..5931a0c8a952 100644 --- a/internal/services/datashare/data_share_dataset_blob_storage_resource_test.go +++ b/internal/services/datashare/data_share_dataset_blob_storage_resource_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/datashare/data_share_dataset_data_lake_gen2_data_source.go b/internal/services/datashare/data_share_dataset_data_lake_gen2_data_source.go index 6f3d7e091da6..914433647b69 100644 --- a/internal/services/datashare/data_share_dataset_data_lake_gen2_data_source.go +++ b/internal/services/datashare/data_share_dataset_data_lake_gen2_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datashare/helper" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datashare/parse" diff --git a/internal/services/datashare/data_share_dataset_data_lake_gen2_resource.go b/internal/services/datashare/data_share_dataset_data_lake_gen2_resource.go index 2afedc816212..eac49b3929b4 100644 --- a/internal/services/datashare/data_share_dataset_data_lake_gen2_resource.go +++ b/internal/services/datashare/data_share_dataset_data_lake_gen2_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/datashare/helper" diff --git a/internal/services/datashare/data_share_dataset_data_lake_gen2_resource_test.go b/internal/services/datashare/data_share_dataset_data_lake_gen2_resource_test.go index 1681a0914ce1..14db893afb43 100644 --- a/internal/services/datashare/data_share_dataset_data_lake_gen2_resource_test.go +++ b/internal/services/datashare/data_share_dataset_data_lake_gen2_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/datashare/data_share_dataset_kusto_cluster_resource.go b/internal/services/datashare/data_share_dataset_kusto_cluster_resource.go index 4c7b9c19111f..dec41556b965 100644 --- a/internal/services/datashare/data_share_dataset_kusto_cluster_resource.go +++ b/internal/services/datashare/data_share_dataset_kusto_cluster_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/datashare/data_share_dataset_kusto_database_resource.go b/internal/services/datashare/data_share_dataset_kusto_database_resource.go index 4492d42c906d..5083e0e214dd 100644 --- a/internal/services/datashare/data_share_dataset_kusto_database_resource.go +++ b/internal/services/datashare/data_share_dataset_kusto_database_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/datashare/data_share_resource.go b/internal/services/datashare/data_share_resource.go index 2f3825a68605..cd0899d8ef37 100644 --- a/internal/services/datashare/data_share_resource.go +++ b/internal/services/datashare/data_share_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/datashare/helper/data_share.go b/internal/services/datashare/helper/data_share.go index 6d56a0748a8f..944944ef24e5 100644 --- a/internal/services/datashare/helper/data_share.go +++ b/internal/services/datashare/helper/data_share.go @@ -1,7 +1,7 @@ package helper import ( - "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" // nolint: staticcheck ) func GetAzurermDataShareDataSetId(dataset datashare.BasicDataSet) *string { diff --git a/internal/services/devtestlabs/client/client.go b/internal/services/devtestlabs/client/client.go index 8b0dd55dca1c..e4e1398592f8 100644 --- a/internal/services/devtestlabs/client/client.go +++ b/internal/services/devtestlabs/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/devtestlabs/dev_test_global_vm_shutdown_schedule_resource.go b/internal/services/devtestlabs/dev_test_global_vm_shutdown_schedule_resource.go index 9d3db0437c7a..58ab7b0bac15 100644 --- a/internal/services/devtestlabs/dev_test_global_vm_shutdown_schedule_resource.go +++ b/internal/services/devtestlabs/dev_test_global_vm_shutdown_schedule_resource.go @@ -5,7 +5,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/devtestlabs/dev_test_lab_resource.go b/internal/services/devtestlabs/dev_test_lab_resource.go index e71c55e8fcd6..e8fd8d2d65d7 100644 --- a/internal/services/devtestlabs/dev_test_lab_resource.go +++ b/internal/services/devtestlabs/dev_test_lab_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/devtestlabs/dev_test_lab_schedule_resource.go b/internal/services/devtestlabs/dev_test_lab_schedule_resource.go index 646a074cf511..8f08d13ec11b 100644 --- a/internal/services/devtestlabs/dev_test_lab_schedule_resource.go +++ b/internal/services/devtestlabs/dev_test_lab_schedule_resource.go @@ -5,7 +5,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/devtestlabs/dev_test_linux_virtual_machine_resource.go b/internal/services/devtestlabs/dev_test_linux_virtual_machine_resource.go index 2d89d3aae7d3..d42d5ee3d40a 100644 --- a/internal/services/devtestlabs/dev_test_linux_virtual_machine_resource.go +++ b/internal/services/devtestlabs/dev_test_linux_virtual_machine_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/devtestlabs/dev_test_policy_resource.go b/internal/services/devtestlabs/dev_test_policy_resource.go index 62ae309a7b03..000788c6151d 100644 --- a/internal/services/devtestlabs/dev_test_policy_resource.go +++ b/internal/services/devtestlabs/dev_test_policy_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/devtestlabs/dev_test_virtual_network_data_source.go b/internal/services/devtestlabs/dev_test_virtual_network_data_source.go index cb5fb01f4852..e7cd6d36a661 100644 --- a/internal/services/devtestlabs/dev_test_virtual_network_data_source.go +++ b/internal/services/devtestlabs/dev_test_virtual_network_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/devtestlabs/parse" diff --git a/internal/services/devtestlabs/dev_test_virtual_network_resource.go b/internal/services/devtestlabs/dev_test_virtual_network_resource.go index b24349967ae5..044064594beb 100644 --- a/internal/services/devtestlabs/dev_test_virtual_network_resource.go +++ b/internal/services/devtestlabs/dev_test_virtual_network_resource.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/devtestlabs/dev_test_windows_virtual_machine_resource.go b/internal/services/devtestlabs/dev_test_windows_virtual_machine_resource.go index ef001118ba5f..d334b6a2e645 100644 --- a/internal/services/devtestlabs/dev_test_windows_virtual_machine_resource.go +++ b/internal/services/devtestlabs/dev_test_windows_virtual_machine_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/devtestlabs/helpers.go b/internal/services/devtestlabs/helpers.go index 938dde67444a..bfaf762a50bd 100644 --- a/internal/services/devtestlabs/helpers.go +++ b/internal/services/devtestlabs/helpers.go @@ -1,7 +1,7 @@ package devtestlabs import ( - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" diff --git a/internal/services/devtestlabs/validate/devtest.go b/internal/services/devtestlabs/validate/devtest.go index 3f54d0d7e3f9..bdbe07574532 100644 --- a/internal/services/devtestlabs/validate/devtest.go +++ b/internal/services/devtestlabs/validate/devtest.go @@ -4,7 +4,7 @@ import ( "fmt" "regexp" - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" ) diff --git a/internal/services/digitaltwins/client/client.go b/internal/services/digitaltwins/client/client.go index 86072925a754..a1943278c825 100644 --- a/internal/services/digitaltwins/client/client.go +++ b/internal/services/digitaltwins/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins" + "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/digitaltwins/digital_twins_endpoint_eventgrid_resource.go b/internal/services/digitaltwins/digital_twins_endpoint_eventgrid_resource.go index 122b582166b1..c605f85a158a 100644 --- a/internal/services/digitaltwins/digital_twins_endpoint_eventgrid_resource.go +++ b/internal/services/digitaltwins/digital_twins_endpoint_eventgrid_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins" + "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/digitaltwins/parse" diff --git a/internal/services/digitaltwins/digital_twins_endpoint_eventhub_resource.go b/internal/services/digitaltwins/digital_twins_endpoint_eventhub_resource.go index 1ab6bbe39388..07442696a000 100644 --- a/internal/services/digitaltwins/digital_twins_endpoint_eventhub_resource.go +++ b/internal/services/digitaltwins/digital_twins_endpoint_eventhub_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins" + "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/digitaltwins/parse" diff --git a/internal/services/digitaltwins/digital_twins_endpoint_servicebus_resource.go b/internal/services/digitaltwins/digital_twins_endpoint_servicebus_resource.go index 65b73dc57672..a870e169a3e7 100644 --- a/internal/services/digitaltwins/digital_twins_endpoint_servicebus_resource.go +++ b/internal/services/digitaltwins/digital_twins_endpoint_servicebus_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins" + "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/digitaltwins/parse" diff --git a/internal/services/digitaltwins/digital_twins_instance_resource.go b/internal/services/digitaltwins/digital_twins_instance_resource.go index d2c1fd353268..0a215f3753ba 100644 --- a/internal/services/digitaltwins/digital_twins_instance_resource.go +++ b/internal/services/digitaltwins/digital_twins_instance_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins" + "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/domainservices/active_directory_domain_service_trust_resource_test.go b/internal/services/domainservices/active_directory_domain_service_trust_resource_test.go index 629d2571ff2d..b4c7533e7bc0 100644 --- a/internal/services/domainservices/active_directory_domain_service_trust_resource_test.go +++ b/internal/services/domainservices/active_directory_domain_service_trust_resource_test.go @@ -179,7 +179,7 @@ resource "azurerm_active_directory_domain_service_trust" "import" { `, template) } -func (r DomainServiceTrustResource) template(data acceptance.TestData) string { +func (r DomainServiceTrustResource) template(_ acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { features {} diff --git a/internal/services/eventgrid/client/client.go b/internal/services/eventgrid/client/client.go index 5a61a0925b22..870be86261f2 100644 --- a/internal/services/eventgrid/client/client.go +++ b/internal/services/eventgrid/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" + "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/eventgrid/event_subscription.go b/internal/services/eventgrid/event_subscription.go index b983353cc732..77519c520036 100644 --- a/internal/services/eventgrid/event_subscription.go +++ b/internal/services/eventgrid/event_subscription.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" + "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/eventgrid/eventgrid.go b/internal/services/eventgrid/eventgrid.go index 0eb4997b0983..506ae445a6c3 100644 --- a/internal/services/eventgrid/eventgrid.go +++ b/internal/services/eventgrid/eventgrid.go @@ -1,7 +1,7 @@ package eventgrid import ( - "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" + "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/eventgrid/eventgrid_domain_resource.go b/internal/services/eventgrid/eventgrid_domain_resource.go index 58fae37c8b16..563ddbbc5fff 100644 --- a/internal/services/eventgrid/eventgrid_domain_resource.go +++ b/internal/services/eventgrid/eventgrid_domain_resource.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" + "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -70,7 +70,7 @@ func resourceEventGridDomain() *pluginsdk.Resource { }, false), }, - //lintignore:XS003 + // lintignore:XS003 "input_mapping_fields": { Type: pluginsdk.TypeList, Optional: true, @@ -112,7 +112,7 @@ func resourceEventGridDomain() *pluginsdk.Resource { }, }, - //lintignore:XS003 + // lintignore:XS003 "input_mapping_default_values": { Type: pluginsdk.TypeList, Optional: true, diff --git a/internal/services/eventgrid/eventgrid_event_subscription_resource.go b/internal/services/eventgrid/eventgrid_event_subscription_resource.go index 042ade0b0d84..de7172310676 100644 --- a/internal/services/eventgrid/eventgrid_event_subscription_resource.go +++ b/internal/services/eventgrid/eventgrid_event_subscription_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" + "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/eventgrid/parse" diff --git a/internal/services/eventgrid/eventgrid_system_topic_event_subscription_resource.go b/internal/services/eventgrid/eventgrid_system_topic_event_subscription_resource.go index 365b3d9b6bd4..bbd6d31a04c6 100644 --- a/internal/services/eventgrid/eventgrid_system_topic_event_subscription_resource.go +++ b/internal/services/eventgrid/eventgrid_system_topic_event_subscription_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" + "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/eventgrid/eventgrid_system_topic_resource.go b/internal/services/eventgrid/eventgrid_system_topic_resource.go index 85b963e90b6e..3b1e091d8fff 100644 --- a/internal/services/eventgrid/eventgrid_system_topic_resource.go +++ b/internal/services/eventgrid/eventgrid_system_topic_resource.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" + "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/eventgrid/eventgrid_topic_resource.go b/internal/services/eventgrid/eventgrid_topic_resource.go index d8db8cfa397e..ecc14012e209 100644 --- a/internal/services/eventgrid/eventgrid_topic_resource.go +++ b/internal/services/eventgrid/eventgrid_topic_resource.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" + "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -70,7 +70,7 @@ func resourceEventGridTopic() *pluginsdk.Resource { }, false), }, - //lintignore:XS003 + // lintignore:XS003 "input_mapping_fields": { Type: pluginsdk.TypeList, Optional: true, @@ -112,7 +112,7 @@ func resourceEventGridTopic() *pluginsdk.Resource { }, }, - //lintignore:XS003 + // lintignore:XS003 "input_mapping_default_values": { Type: pluginsdk.TypeList, Optional: true, diff --git a/internal/services/fluidrelay/fluid_relay_servers_resource.go b/internal/services/fluidrelay/fluid_relay_servers_resource.go index 8f79da9fb615..9b4a6c9546cb 100644 --- a/internal/services/fluidrelay/fluid_relay_servers_resource.go +++ b/internal/services/fluidrelay/fluid_relay_servers_resource.go @@ -250,20 +250,22 @@ func (s Server) Read() sdk.ResourceFunc { if server.Model.Tags != nil { output.Tags = *server.Model.Tags } - if prop := model.Properties; prop != nil { - if prop.FrsTenantId != nil { - output.FrsTenantId = *prop.FrsTenantId - } - if points := prop.FluidRelayEndpoints; points != nil { - if points.OrdererEndpoints != nil { - output.OrdererEndpoints = *points.OrdererEndpoints - } - if points.StorageEndpoints != nil { - output.StorageEndpoints = *points.StorageEndpoints + if model != nil { + if prop := model.Properties; prop != nil { + if prop.FrsTenantId != nil { + output.FrsTenantId = *prop.FrsTenantId } - - if points.ServiceEndpoints != nil { - output.ServiceEndpoints = *points.ServiceEndpoints + if points := prop.FluidRelayEndpoints; points != nil { + if points.OrdererEndpoints != nil { + output.OrdererEndpoints = *points.OrdererEndpoints + } + if points.StorageEndpoints != nil { + output.StorageEndpoints = *points.StorageEndpoints + } + + if points.ServiceEndpoints != nil { + output.ServiceEndpoints = *points.ServiceEndpoints + } } } } diff --git a/internal/services/frontdoor/frontdoor_resource_test.go b/internal/services/frontdoor/frontdoor_resource_test.go index ef36a3a503dd..bd6d6f4e6530 100644 --- a/internal/services/frontdoor/frontdoor_resource_test.go +++ b/internal/services/frontdoor/frontdoor_resource_test.go @@ -342,74 +342,6 @@ resource "azurerm_frontdoor" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) } -// remove in 3.0 -func (FrontDoorResource) global(data acceptance.TestData) string { - return fmt.Sprintf(` -provider "azurerm" { - features {} -} - -resource "azurerm_resource_group" "test" { - name = "acctestRG-frontdoor-%[1]d" - location = "%[2]s" -} - -locals { - backend_name = "backend-bing" - endpoint_name = "frontend-endpoint" - health_probe_name = "health-probe" - load_balancing_name = "load-balancing-setting" -} - -resource "azurerm_frontdoor" "test" { - name = "acctest-FD-%[1]d" - resource_group_name = azurerm_resource_group.test.name - location = "%[2]s" - - backend_pool_settings { - enforce_backend_pools_certificate_name_check = false - } - - routing_rule { - name = "routing-rule" - accepted_protocols = ["Http", "Https"] - patterns_to_match = ["/*"] - frontend_endpoints = [local.endpoint_name] - forwarding_configuration { - forwarding_protocol = "MatchRequest" - backend_pool_name = local.backend_name - } - } - - backend_pool_load_balancing { - name = local.load_balancing_name - } - - backend_pool_health_probe { - name = local.health_probe_name - } - - backend_pool { - name = local.backend_name - backend { - host_header = "www.bing.com" - address = "www.bing.com" - http_port = 80 - https_port = 443 - } - - load_balancing_name = local.load_balancing_name - health_probe_name = local.health_probe_name - } - - frontend_endpoint { - name = local.endpoint_name - host_name = "acctest-FD-%[1]d.azurefd.net" - } -} -`, data.RandomInteger, data.Locations.Primary) -} - func (r FrontDoorResource) requiresImport(data acceptance.TestData) string { return fmt.Sprintf(` %s diff --git a/internal/services/hdinsight/client/client.go b/internal/services/hdinsight/client/client.go index 8099d8c6001a..de5799708635 100644 --- a/internal/services/hdinsight/client/client.go +++ b/internal/services/hdinsight/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" + "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/hdinsight/common_hdinsight.go b/internal/services/hdinsight/common_hdinsight.go index 9a1e639421a6..33396ba87f42 100644 --- a/internal/services/hdinsight/common_hdinsight.go +++ b/internal/services/hdinsight/common_hdinsight.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" + "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/hdinsight/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" diff --git a/internal/services/hdinsight/hdinsight_hadoop_cluster_resource.go b/internal/services/hdinsight/hdinsight_hadoop_cluster_resource.go index e8b1bab8d273..8e2ec520ad88 100644 --- a/internal/services/hdinsight/hdinsight_hadoop_cluster_resource.go +++ b/internal/services/hdinsight/hdinsight_hadoop_cluster_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" + "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/hdinsight/hdinsight_hbase_cluster_resource.go b/internal/services/hdinsight/hdinsight_hbase_cluster_resource.go index 55b68437992f..616877b33cde 100644 --- a/internal/services/hdinsight/hdinsight_hbase_cluster_resource.go +++ b/internal/services/hdinsight/hdinsight_hbase_cluster_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" + "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/hdinsight/hdinsight_interactive_query_cluster_resource.go b/internal/services/hdinsight/hdinsight_interactive_query_cluster_resource.go index 843329e0bccf..c6e18ecc7ea7 100644 --- a/internal/services/hdinsight/hdinsight_interactive_query_cluster_resource.go +++ b/internal/services/hdinsight/hdinsight_interactive_query_cluster_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" + "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/hdinsight/hdinsight_kafka_cluster_resource.go b/internal/services/hdinsight/hdinsight_kafka_cluster_resource.go index 6a3b9cdae5fe..1e1f332b21f2 100644 --- a/internal/services/hdinsight/hdinsight_kafka_cluster_resource.go +++ b/internal/services/hdinsight/hdinsight_kafka_cluster_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" + "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/hdinsight/hdinsight_spark_cluster_resource.go b/internal/services/hdinsight/hdinsight_spark_cluster_resource.go index 9c0dca179fbe..69ab576e1377 100644 --- a/internal/services/hdinsight/hdinsight_spark_cluster_resource.go +++ b/internal/services/hdinsight/hdinsight_spark_cluster_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" + "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/hdinsight/schema.go b/internal/services/hdinsight/schema.go index 7bf6c394e54e..ae92289c3262 100644 --- a/internal/services/hdinsight/schema.go +++ b/internal/services/hdinsight/schema.go @@ -6,7 +6,7 @@ import ( "regexp" "strings" - "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" + "github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/healthcare/client/client.go b/internal/services/healthcare/client/client.go index f699d48e44b1..76a6e76b3a66 100644 --- a/internal/services/healthcare/client/client.go +++ b/internal/services/healthcare/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" + "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/healthcare/healthcare_dicom_resource.go b/internal/services/healthcare/healthcare_dicom_resource.go index 0b609725a8c1..0046e73ba93b 100644 --- a/internal/services/healthcare/healthcare_dicom_resource.go +++ b/internal/services/healthcare/healthcare_dicom_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" + "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/internal/services/healthcare/healthcare_fhir_resource.go b/internal/services/healthcare/healthcare_fhir_resource.go index f3225388a397..a9d67a2a8956 100644 --- a/internal/services/healthcare/healthcare_fhir_resource.go +++ b/internal/services/healthcare/healthcare_fhir_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" + "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/internal/services/healthcare/healthcare_medtech_service_fhir_destination_resource.go b/internal/services/healthcare/healthcare_medtech_service_fhir_destination_resource.go index 24ea1139ce50..de20fec0108b 100644 --- a/internal/services/healthcare/healthcare_medtech_service_fhir_destination_resource.go +++ b/internal/services/healthcare/healthcare_medtech_service_fhir_destination_resource.go @@ -7,7 +7,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" + "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/healthcare/healthcare_medtech_service_resource.go b/internal/services/healthcare/healthcare_medtech_service_resource.go index 6c5d45a959ea..23ead0dab836 100644 --- a/internal/services/healthcare/healthcare_medtech_service_resource.go +++ b/internal/services/healthcare/healthcare_medtech_service_resource.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" + "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/internal/services/healthcare/healthcare_service_resource.go b/internal/services/healthcare/healthcare_service_resource.go index a895d00a1142..dc6c77f0bcbe 100644 --- a/internal/services/healthcare/healthcare_service_resource.go +++ b/internal/services/healthcare/healthcare_service_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" + "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/healthcare/healthcare_workspace_resource.go b/internal/services/healthcare/healthcare_workspace_resource.go index 462bf317f1a6..2b3fe1d5987b 100644 --- a/internal/services/healthcare/healthcare_workspace_resource.go +++ b/internal/services/healthcare/healthcare_workspace_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" + "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/hpccache/client/client.go b/internal/services/hpccache/client/client.go index 3e4863428f14..08be9b751c72 100644 --- a/internal/services/hpccache/client/client.go +++ b/internal/services/hpccache/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" + "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/hpccache/hpc_cache.go b/internal/services/hpccache/hpc_cache.go index ecafe1ab67c8..c28dc73f667e 100644 --- a/internal/services/hpccache/hpc_cache.go +++ b/internal/services/hpccache/hpc_cache.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" + "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/hpccache/hpc_cache_access_policy_resource.go b/internal/services/hpccache/hpc_cache_access_policy_resource.go index ae292d54a0bb..fa59b4bed7ce 100644 --- a/internal/services/hpccache/hpc_cache_access_policy_resource.go +++ b/internal/services/hpccache/hpc_cache_access_policy_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" + "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" diff --git a/internal/services/hpccache/hpc_cache_blob_nfs_target_resource.go b/internal/services/hpccache/hpc_cache_blob_nfs_target_resource.go index 48670c23378b..9fe4f0f1c1a4 100644 --- a/internal/services/hpccache/hpc_cache_blob_nfs_target_resource.go +++ b/internal/services/hpccache/hpc_cache_blob_nfs_target_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" + "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/hpccache/hpc_cache_blob_target_resource.go b/internal/services/hpccache/hpc_cache_blob_target_resource.go index e7bcd04d1047..01a6702ff56a 100644 --- a/internal/services/hpccache/hpc_cache_blob_target_resource.go +++ b/internal/services/hpccache/hpc_cache_blob_target_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" + "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/hpccache/hpc_cache_nfs_target_resource.go b/internal/services/hpccache/hpc_cache_nfs_target_resource.go index da4179308a74..cb01b1f410fe 100644 --- a/internal/services/hpccache/hpc_cache_nfs_target_resource.go +++ b/internal/services/hpccache/hpc_cache_nfs_target_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" + "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/hpccache/hpc_cache_resource.go b/internal/services/hpccache/hpc_cache_resource.go index 500612e024e5..63cd62a94e8a 100644 --- a/internal/services/hpccache/hpc_cache_resource.go +++ b/internal/services/hpccache/hpc_cache_resource.go @@ -8,7 +8,7 @@ import ( "strconv" "time" - "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" + "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-09-01/storagecache" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/internal/services/iotcentral/iotcentral_application_network_rule_set_resource_test.go b/internal/services/iotcentral/iotcentral_application_network_rule_set_resource_test.go index c9025b546e75..4b8f27bc209c 100644 --- a/internal/services/iotcentral/iotcentral_application_network_rule_set_resource_test.go +++ b/internal/services/iotcentral/iotcentral_application_network_rule_set_resource_test.go @@ -183,7 +183,7 @@ func (IoTCentralApplicationNetworkRuleSetResource) Exists(ctx context.Context, c return nil, fmt.Errorf("retrieving %s: %+v", *id, err) } - return utils.Bool(resp.Model != nil && resp.Model.Properties != nil && &resp.Model.Properties.NetworkRuleSets != nil), nil + return utils.Bool(resp.Model != nil && resp.Model.Properties != nil && resp.Model.Properties.NetworkRuleSets != nil), nil } func (r IoTCentralApplicationNetworkRuleSetResource) basic(data acceptance.TestData) string { diff --git a/internal/services/iotcentral/iotcentral_application_resource.go b/internal/services/iotcentral/iotcentral_application_resource.go index 47b6f064b554..5865b4c14c70 100644 --- a/internal/services/iotcentral/iotcentral_application_resource.go +++ b/internal/services/iotcentral/iotcentral_application_resource.go @@ -170,7 +170,7 @@ func resourceIotCentralAppCreate(d *pluginsdk.ResourceData, meta interface{}) er } // Public Network Access can only be disabled after creation - if d.Get("public_network_access_enabled").(bool) == false { + if !d.Get("public_network_access_enabled").(bool) { publicNetworkAccess := apps.PublicNetworkAccessDisabled app.Properties.PublicNetworkAccess = &publicNetworkAccess if err := client.CreateOrUpdateThenPoll(ctx, id, app); err != nil { diff --git a/internal/services/iothub/iothub_device_update_instance_resource.go b/internal/services/iothub/iothub_device_update_instance_resource.go index 5b638d77e3f5..ddf0aed864bb 100644 --- a/internal/services/iothub/iothub_device_update_instance_resource.go +++ b/internal/services/iothub/iothub_device_update_instance_resource.go @@ -202,11 +202,7 @@ func (r IotHubDeviceUpdateInstanceResource) Read() sdk.ResourceFunc { state.IotHubId = (*iotHubs)[0].ResourceId } - diagnosticStorageAccount, err := flattenDiagnosticStorageAccount(properties.DiagnosticStorageProperties, metadata) - if err != nil { - return err - } - state.DiagnosticStorageAccount = diagnosticStorageAccount + state.DiagnosticStorageAccount = flattenDiagnosticStorageAccount(properties.DiagnosticStorageProperties, metadata) diagnosticEnabled := false if properties.EnableDiagnostics != nil { @@ -307,10 +303,10 @@ func expandDiagnosticStorageAccount(inputList []DiagnosticStorageAccountModel) * return &output } -func flattenDiagnosticStorageAccount(input *deviceupdates.DiagnosticStorageProperties, metadata sdk.ResourceMetaData) ([]DiagnosticStorageAccountModel, error) { +func flattenDiagnosticStorageAccount(input *deviceupdates.DiagnosticStorageProperties, metadata sdk.ResourceMetaData) []DiagnosticStorageAccountModel { var outputList []DiagnosticStorageAccountModel if input == nil { - return outputList, nil + return outputList } output := DiagnosticStorageAccountModel{ @@ -322,5 +318,5 @@ func flattenDiagnosticStorageAccount(input *deviceupdates.DiagnosticStoragePrope output.ConnectionString = connectionString.(string) } - return append(outputList, output), nil + return append(outputList, output) } diff --git a/internal/services/iothub/iothub_dps_shared_access_policy_data_source.go b/internal/services/iothub/iothub_dps_shared_access_policy_data_source.go index eafcc2b7a9e4..1e9a5d906c0c 100644 --- a/internal/services/iothub/iothub_dps_shared_access_policy_data_source.go +++ b/internal/services/iothub/iothub_dps_shared_access_policy_data_source.go @@ -95,12 +95,11 @@ func dataSourceIotHubDPSSharedAccessPolicyRead(d *pluginsdk.ResourceData, meta i d.Set("resource_group_name", keyId.ResourceGroupName) d.SetId(id.ID()) - if model := accessPolicy.Model; model != nil { d.Set("primary_key", model.PrimaryKey) d.Set("secondary_key", model.SecondaryKey) - if dpsModel := iothubDps.Model; model != nil { + if dpsModel := iothubDps.Model; dpsModel != nil { properties := dpsModel.Properties primaryConnectionString := "" secondaryConnectionString := "" diff --git a/internal/services/iothub/iothub_dps_shared_access_policy_resource.go b/internal/services/iothub/iothub_dps_shared_access_policy_resource.go index aff0d2976567..2604f6a8e989 100644 --- a/internal/services/iothub/iothub_dps_shared_access_policy_resource.go +++ b/internal/services/iothub/iothub_dps_shared_access_policy_resource.go @@ -225,7 +225,7 @@ func resourceIotHubDPSSharedAccessPolicyRead(d *pluginsdk.ResourceData, meta int d.Set("primary_key", model.PrimaryKey) d.Set("secondary_key", model.SecondaryKey) - if iothubDpsModel := iothubDps.Model; model != nil { + if iothubDpsModel := iothubDps.Model; iothubDpsModel != nil { primaryConnectionString := "" secondaryConnectionString := "" properties := iothubDpsModel.Properties diff --git a/internal/services/iottimeseriesinsights/client/client.go b/internal/services/iottimeseriesinsights/client/client.go index 2096f5ea4f26..eac05f438b5c 100644 --- a/internal/services/iottimeseriesinsights/client/client.go +++ b/internal/services/iottimeseriesinsights/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" + "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/iottimeseriesinsights/iot_time_series_insights_access_policy_resource.go b/internal/services/iottimeseriesinsights/iot_time_series_insights_access_policy_resource.go index 5b748e8a3546..f3547cfe96b0 100644 --- a/internal/services/iottimeseriesinsights/iot_time_series_insights_access_policy_resource.go +++ b/internal/services/iottimeseriesinsights/iot_time_series_insights_access_policy_resource.go @@ -5,7 +5,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" + "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/iottimeseriesinsights/migration" diff --git a/internal/services/iottimeseriesinsights/iot_time_series_insights_event_source_eventhub.go b/internal/services/iottimeseriesinsights/iot_time_series_insights_event_source_eventhub.go index 751d290b0d7e..ed9b29d027df 100644 --- a/internal/services/iottimeseriesinsights/iot_time_series_insights_event_source_eventhub.go +++ b/internal/services/iottimeseriesinsights/iot_time_series_insights_event_source_eventhub.go @@ -5,7 +5,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" + "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/iottimeseriesinsights/iot_time_series_insights_event_source_iothub.go b/internal/services/iottimeseriesinsights/iot_time_series_insights_event_source_iothub.go index ac9c721a703c..a5a95da7e649 100644 --- a/internal/services/iottimeseriesinsights/iot_time_series_insights_event_source_iothub.go +++ b/internal/services/iottimeseriesinsights/iot_time_series_insights_event_source_iothub.go @@ -5,7 +5,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" + "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/iottimeseriesinsights/iot_time_series_insights_gen2_environment_resource.go b/internal/services/iottimeseriesinsights/iot_time_series_insights_gen2_environment_resource.go index b32167a73496..c493d8319f18 100644 --- a/internal/services/iottimeseriesinsights/iot_time_series_insights_gen2_environment_resource.go +++ b/internal/services/iottimeseriesinsights/iot_time_series_insights_gen2_environment_resource.go @@ -5,7 +5,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" + "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/iottimeseriesinsights/iot_time_series_insights_reference_data_set_resource.go b/internal/services/iottimeseriesinsights/iot_time_series_insights_reference_data_set_resource.go index 6e46b90b412e..b093ea701f41 100644 --- a/internal/services/iottimeseriesinsights/iot_time_series_insights_reference_data_set_resource.go +++ b/internal/services/iottimeseriesinsights/iot_time_series_insights_reference_data_set_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" + "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/iottimeseriesinsights/iot_time_series_insights_standard_environment_resource.go b/internal/services/iottimeseriesinsights/iot_time_series_insights_standard_environment_resource.go index dd7d1f209003..0ad4305c9444 100644 --- a/internal/services/iottimeseriesinsights/iot_time_series_insights_standard_environment_resource.go +++ b/internal/services/iottimeseriesinsights/iot_time_series_insights_standard_environment_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" + "github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/keyvault/access_policy_schema.go b/internal/services/keyvault/access_policy_schema.go index 1c1b1c76f9a9..b12fa3358de3 100644 --- a/internal/services/keyvault/access_policy_schema.go +++ b/internal/services/keyvault/access_policy_schema.go @@ -3,7 +3,7 @@ package keyvault import ( "strings" - "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" + "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" // nolint: staticcheck "github.com/gofrs/uuid" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" diff --git a/internal/services/keyvault/client/client.go b/internal/services/keyvault/client/client.go index c6ae1f2bceb2..b6958de3f183 100644 --- a/internal/services/keyvault/client/client.go +++ b/internal/services/keyvault/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" + "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" // nolint: staticcheck keyvaultmgmt "github.com/Azure/azure-sdk-for-go/services/keyvault/v7.1/keyvault" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/keyvault/key_vault_access_policy_data_source.go b/internal/services/keyvault/key_vault_access_policy_data_source.go index d78bae3f4a43..0c17f517308f 100644 --- a/internal/services/keyvault/key_vault_access_policy_data_source.go +++ b/internal/services/keyvault/key_vault_access_policy_data_source.go @@ -4,7 +4,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" + "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/keyvault/key_vault_access_policy_resource.go b/internal/services/keyvault/key_vault_access_policy_resource.go index 5353bc9bfb4c..bb2c709f14f0 100644 --- a/internal/services/keyvault/key_vault_access_policy_resource.go +++ b/internal/services/keyvault/key_vault_access_policy_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" + "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" // nolint: staticcheck "github.com/gofrs/uuid" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/keyvault/key_vault_data_source.go b/internal/services/keyvault/key_vault_data_source.go index ad03262f124d..eb5c82e96ab8 100644 --- a/internal/services/keyvault/key_vault_data_source.go +++ b/internal/services/keyvault/key_vault_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" + "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/keyvault/key_vault_managed_hardware_security_module_resource.go b/internal/services/keyvault/key_vault_managed_hardware_security_module_resource.go index 7eb86a328ec4..cbdeceb01ce6 100644 --- a/internal/services/keyvault/key_vault_managed_hardware_security_module_resource.go +++ b/internal/services/keyvault/key_vault_managed_hardware_security_module_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" + "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" // nolint: staticcheck "github.com/gofrs/uuid" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" diff --git a/internal/services/keyvault/key_vault_resource.go b/internal/services/keyvault/key_vault_resource.go index a3fd9cb99421..b8f9334d1abf 100644 --- a/internal/services/keyvault/key_vault_resource.go +++ b/internal/services/keyvault/key_vault_resource.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" + "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2021-10-01/keyvault" // nolint: staticcheck KeyVaultMgmt "github.com/Azure/azure-sdk-for-go/services/keyvault/v7.1/keyvault" "github.com/gofrs/uuid" "github.com/hashicorp/go-azure-helpers/lang/response" diff --git a/internal/services/kusto/client/client.go b/internal/services/kusto/client/client.go index 551eff602bb0..4fd6a741d4e8 100644 --- a/internal/services/kusto/client/client.go +++ b/internal/services/kusto/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/kusto/identity.go b/internal/services/kusto/identity.go index f74767d9ae54..58ad3b3e20db 100644 --- a/internal/services/kusto/identity.go +++ b/internal/services/kusto/identity.go @@ -1,7 +1,7 @@ package kusto import ( - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/kusto/kusto_attached_database_configuration_resource.go b/internal/services/kusto/kusto_attached_database_configuration_resource.go index 2db921981953..736258bceddc 100644 --- a/internal/services/kusto/kusto_attached_database_configuration_resource.go +++ b/internal/services/kusto/kusto_attached_database_configuration_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/kusto/kusto_cluster_customer_managed_key_resource.go b/internal/services/kusto/kusto_cluster_customer_managed_key_resource.go index 0216be47c5ce..f7addfcd9de3 100644 --- a/internal/services/kusto/kusto_cluster_customer_managed_key_resource.go +++ b/internal/services/kusto/kusto_cluster_customer_managed_key_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/kusto/kusto_cluster_managed_private_endpoint_resource.go b/internal/services/kusto/kusto_cluster_managed_private_endpoint_resource.go index d358790bb1f8..5cdcb059407d 100644 --- a/internal/services/kusto/kusto_cluster_managed_private_endpoint_resource.go +++ b/internal/services/kusto/kusto_cluster_managed_private_endpoint_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/kusto/kusto_cluster_principal_assignment_resource.go b/internal/services/kusto/kusto_cluster_principal_assignment_resource.go index 628b68c0e17c..70c6930cfb99 100644 --- a/internal/services/kusto/kusto_cluster_principal_assignment_resource.go +++ b/internal/services/kusto/kusto_cluster_principal_assignment_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/kusto/kusto_cluster_resource.go b/internal/services/kusto/kusto_cluster_resource.go index 3ac205c529b5..0b5ae353e956 100644 --- a/internal/services/kusto/kusto_cluster_resource.go +++ b/internal/services/kusto/kusto_cluster_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" @@ -547,7 +547,7 @@ func flattenOptimizedAutoScale(optimizedAutoScale *kusto.OptimizedAutoscale) []i } func expandKustoListString(input []interface{}) (*[]string, error) { - if input == nil || len(input) == 0 { + if len(input) == 0 { return nil, fmt.Errorf("list of string is empty") } diff --git a/internal/services/kusto/kusto_data_connection_import.go b/internal/services/kusto/kusto_data_connection_import.go index c6f87a87302b..8cdc9b6dc47a 100644 --- a/internal/services/kusto/kusto_data_connection_import.go +++ b/internal/services/kusto/kusto_data_connection_import.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/kusto/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/kusto/kusto_database_principal_assignment_resource.go b/internal/services/kusto/kusto_database_principal_assignment_resource.go index b1cb429845fe..7dff23189dbf 100644 --- a/internal/services/kusto/kusto_database_principal_assignment_resource.go +++ b/internal/services/kusto/kusto_database_principal_assignment_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/kusto/kusto_database_resource.go b/internal/services/kusto/kusto_database_resource.go index 18fb55f66091..70624b4c935c 100644 --- a/internal/services/kusto/kusto_database_resource.go +++ b/internal/services/kusto/kusto_database_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/kusto/kusto_database_script_resource.go b/internal/services/kusto/kusto_database_script_resource.go index dfa4e822a96c..3fffb2538218 100644 --- a/internal/services/kusto/kusto_database_script_resource.go +++ b/internal/services/kusto/kusto_database_script_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/kusto/kusto_eventgrid_data_connection_resource.go b/internal/services/kusto/kusto_eventgrid_data_connection_resource.go index 19edde627d78..81b1e37c6f3e 100644 --- a/internal/services/kusto/kusto_eventgrid_data_connection_resource.go +++ b/internal/services/kusto/kusto_eventgrid_data_connection_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/kusto/kusto_eventhub_data_connection_resource.go b/internal/services/kusto/kusto_eventhub_data_connection_resource.go index ac0c7a0a2ce7..6d87538a5dbc 100644 --- a/internal/services/kusto/kusto_eventhub_data_connection_resource.go +++ b/internal/services/kusto/kusto_eventhub_data_connection_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/eventhubs" diff --git a/internal/services/kusto/kusto_iothub_data_connection_resource.go b/internal/services/kusto/kusto_iothub_data_connection_resource.go index 5cfe42190800..fa674a66c8c3 100644 --- a/internal/services/kusto/kusto_iothub_data_connection_resource.go +++ b/internal/services/kusto/kusto_iothub_data_connection_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" + "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/loadbalancer/loadbalancer_resource.go b/internal/services/loadbalancer/loadbalancer_resource.go index 2d93e0aa5c7c..908947353a64 100644 --- a/internal/services/loadbalancer/loadbalancer_resource.go +++ b/internal/services/loadbalancer/loadbalancer_resource.go @@ -88,11 +88,7 @@ func resourceArmLoadBalancerCreateUpdate(d *pluginsdk.ResourceData, meta interfa properties := network.LoadBalancerPropertiesFormat{} if _, ok := d.GetOk("frontend_ip_configuration"); ok { - frontendIPConfigurations, err := expandAzureRmLoadBalancerFrontendIpConfigurations(d) - if err != nil { - return err - } - properties.FrontendIPConfigurations = frontendIPConfigurations + properties.FrontendIPConfigurations = expandAzureRmLoadBalancerFrontendIpConfigurations(d) } loadBalancer := network.LoadBalancer{ @@ -197,7 +193,7 @@ func resourceArmLoadBalancerDelete(d *pluginsdk.ResourceData, meta interface{}) return nil } -func expandAzureRmLoadBalancerFrontendIpConfigurations(d *pluginsdk.ResourceData) (*[]network.FrontendIPConfiguration, error) { +func expandAzureRmLoadBalancerFrontendIpConfigurations(d *pluginsdk.ResourceData) *[]network.FrontendIPConfiguration { configs := d.Get("frontend_ip_configuration").([]interface{}) frontEndConfigs := make([]network.FrontendIPConfiguration, 0, len(configs)) @@ -254,7 +250,7 @@ func expandAzureRmLoadBalancerFrontendIpConfigurations(d *pluginsdk.ResourceData frontEndConfigs = append(frontEndConfigs, frontEndConfig) } - return &frontEndConfigs, nil + return &frontEndConfigs } func flattenLoadBalancerFrontendIpConfiguration(ipConfigs *[]network.FrontendIPConfiguration) []interface{} { diff --git a/internal/services/loganalytics/log_analytics_workspace_resource.go b/internal/services/loganalytics/log_analytics_workspace_resource.go index 6956cc9737ef..2be3c93407f7 100644 --- a/internal/services/loganalytics/log_analytics_workspace_resource.go +++ b/internal/services/loganalytics/log_analytics_workspace_resource.go @@ -239,6 +239,7 @@ func resourceLogAnalyticsWorkspaceCreateUpdate(d *pluginsdk.ResourceData, meta i }, } + // nolint : staticcheck if v, ok := d.GetOkExists("cmk_for_query_forced"); ok { parameters.Properties.ForceCmkForQuery = utils.Bool(v.(bool)) } diff --git a/internal/services/logic/client/client.go b/internal/services/logic/client/client.go index 1f301a79efbd..a93288b8f94d 100644 --- a/internal/services/logic/client/client.go +++ b/internal/services/logic/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/logic/integration_service_environment.go b/internal/services/logic/integration_service_environment.go index 58e6d85dd9ee..a9269669a26e 100644 --- a/internal/services/logic/integration_service_environment.go +++ b/internal/services/logic/integration_service_environment.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/logic/logic_app_action_http_resource.go b/internal/services/logic/logic_app_action_http_resource.go index 12aff81e01a7..9e16a5a6c4d8 100644 --- a/internal/services/logic/logic_app_action_http_resource.go +++ b/internal/services/logic/logic_app_action_http_resource.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/services/logic/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" diff --git a/internal/services/logic/logic_app_integration_account_agreement_resource.go b/internal/services/logic/logic_app_integration_account_agreement_resource.go index 0713c12589d6..13973e85dbdc 100644 --- a/internal/services/logic/logic_app_integration_account_agreement_resource.go +++ b/internal/services/logic/logic_app_integration_account_agreement_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/logic/logic_app_integration_account_assembly_resource.go b/internal/services/logic/logic_app_integration_account_assembly_resource.go index eb86712261f9..6085ab57cdc4 100644 --- a/internal/services/logic/logic_app_integration_account_assembly_resource.go +++ b/internal/services/logic/logic_app_integration_account_assembly_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/logic/logic_app_integration_account_batch_configuration_resource.go b/internal/services/logic/logic_app_integration_account_batch_configuration_resource.go index 81eb8e773667..489116c770c7 100644 --- a/internal/services/logic/logic_app_integration_account_batch_configuration_resource.go +++ b/internal/services/logic/logic_app_integration_account_batch_configuration_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/logic/logic_app_integration_account_certificate_resource.go b/internal/services/logic/logic_app_integration_account_certificate_resource.go index 1cf137f3a17d..624173eb75ee 100644 --- a/internal/services/logic/logic_app_integration_account_certificate_resource.go +++ b/internal/services/logic/logic_app_integration_account_certificate_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/logic/logic_app_integration_account_map_resource.go b/internal/services/logic/logic_app_integration_account_map_resource.go index 1951639b0a4e..36493a6ec96e 100644 --- a/internal/services/logic/logic_app_integration_account_map_resource.go +++ b/internal/services/logic/logic_app_integration_account_map_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/logic/logic_app_integration_account_partner_resource.go b/internal/services/logic/logic_app_integration_account_partner_resource.go index 13a94eb38986..e1cf617d6cc4 100644 --- a/internal/services/logic/logic_app_integration_account_partner_resource.go +++ b/internal/services/logic/logic_app_integration_account_partner_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/logic/logic_app_integration_account_resource.go b/internal/services/logic/logic_app_integration_account_resource.go index 6dc76582fcb7..7c82f549f2fb 100644 --- a/internal/services/logic/logic_app_integration_account_resource.go +++ b/internal/services/logic/logic_app_integration_account_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/logic/logic_app_integration_account_schema_resource.go b/internal/services/logic/logic_app_integration_account_schema_resource.go index 235d8c872dc2..dc80710c82bb 100644 --- a/internal/services/logic/logic_app_integration_account_schema_resource.go +++ b/internal/services/logic/logic_app_integration_account_schema_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/logic/logic_app_integration_account_session_resource.go b/internal/services/logic/logic_app_integration_account_session_resource.go index 7e88b8af6bf8..7a234eb9f994 100644 --- a/internal/services/logic/logic_app_integration_account_session_resource.go +++ b/internal/services/logic/logic_app_integration_account_session_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/logic/logic_app_standard_data_source.go b/internal/services/logic/logic_app_standard_data_source.go index a3ff7b0cb8aa..a4333211fe35 100644 --- a/internal/services/logic/logic_app_standard_data_source.go +++ b/internal/services/logic/logic_app_standard_data_source.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/logic/logic_app_standard_resource.go b/internal/services/logic/logic_app_standard_resource.go index b519f005d614..63892c3d5b34 100644 --- a/internal/services/logic/logic_app_standard_resource.go +++ b/internal/services/logic/logic_app_standard_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/logic/logic_app_workflow_data_source.go b/internal/services/logic/logic_app_workflow_data_source.go index e36d95040398..33d616c8c746 100644 --- a/internal/services/logic/logic_app_workflow_data_source.go +++ b/internal/services/logic/logic_app_workflow_data_source.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/logic/logic_app_workflow_resource.go b/internal/services/logic/logic_app_workflow_resource.go index 3b26d394cf19..bf20995ef047 100644 --- a/internal/services/logic/logic_app_workflow_resource.go +++ b/internal/services/logic/logic_app_workflow_resource.go @@ -8,7 +8,7 @@ import ( "strconv" "time" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/internal/services/logic/logic_apps.go b/internal/services/logic/logic_apps.go index 5cf2b6382477..edc3d41d605e 100644 --- a/internal/services/logic/logic_apps.go +++ b/internal/services/logic/logic_apps.go @@ -4,7 +4,7 @@ import ( "fmt" "log" - "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" + "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" diff --git a/internal/services/logz/client/client.go b/internal/services/logz/client/client.go index ee1d772446a9..94c1b6fecd3d 100644 --- a/internal/services/logz/client/client.go +++ b/internal/services/logz/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/logz/mgmt/2020-10-01/logz" + "github.com/Azure/azure-sdk-for-go/services/logz/mgmt/2020-10-01/logz" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/logz/logz_common.go b/internal/services/logz/logz_common.go index 2a603b2e4a8f..e07a2728c39f 100644 --- a/internal/services/logz/logz_common.go +++ b/internal/services/logz/logz_common.go @@ -1,7 +1,7 @@ package logz import ( - "github.com/Azure/azure-sdk-for-go/services/logz/mgmt/2020-10-01/logz" + "github.com/Azure/azure-sdk-for-go/services/logz/mgmt/2020-10-01/logz" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/logz/logz_monitor_resource.go b/internal/services/logz/logz_monitor_resource.go index d0cac70715cd..2cd3598c73a4 100644 --- a/internal/services/logz/logz_monitor_resource.go +++ b/internal/services/logz/logz_monitor_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/logz/mgmt/2020-10-01/logz" + "github.com/Azure/azure-sdk-for-go/services/logz/mgmt/2020-10-01/logz" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/logz/logz_sub_account_resource.go b/internal/services/logz/logz_sub_account_resource.go index 8da494e0d7b8..e00dcb49c353 100644 --- a/internal/services/logz/logz_sub_account_resource.go +++ b/internal/services/logz/logz_sub_account_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/logz/mgmt/2020-10-01/logz" + "github.com/Azure/azure-sdk-for-go/services/logz/mgmt/2020-10-01/logz" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/logz/parse" diff --git a/internal/services/logz/logz_sub_account_tag_rule_resource.go b/internal/services/logz/logz_sub_account_tag_rule_resource.go index 4cb65c0f719d..6676667ccfe2 100644 --- a/internal/services/logz/logz_sub_account_tag_rule_resource.go +++ b/internal/services/logz/logz_sub_account_tag_rule_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/logz/mgmt/2020-10-01/logz" + "github.com/Azure/azure-sdk-for-go/services/logz/mgmt/2020-10-01/logz" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/logz/parse" diff --git a/internal/services/logz/logz_tag_rule_resource.go b/internal/services/logz/logz_tag_rule_resource.go index 8c282ca1f50d..140304b6becc 100644 --- a/internal/services/logz/logz_tag_rule_resource.go +++ b/internal/services/logz/logz_tag_rule_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/logz/mgmt/2020-10-01/logz" + "github.com/Azure/azure-sdk-for-go/services/logz/mgmt/2020-10-01/logz" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/logz/parse" diff --git a/internal/services/machinelearning/machine_learning_workspace_resource.go b/internal/services/machinelearning/machine_learning_workspace_resource.go index d5f563f08dfc..59ba7eb2f45d 100644 --- a/internal/services/machinelearning/machine_learning_workspace_resource.go +++ b/internal/services/machinelearning/machine_learning_workspace_resource.go @@ -235,6 +235,7 @@ func resourceMachineLearningWorkspaceCreateOrUpdate(d *pluginsdk.ResourceData, m networkAccessBehindVnetEnabled := false + // nolint: staticcheck if v, ok := d.GetOkExists("public_network_access_enabled"); ok { networkAccessBehindVnetEnabled = v.(bool) } diff --git a/internal/services/maintenance/public_maintenance_configurations_data_source_test.go b/internal/services/maintenance/public_maintenance_configurations_data_source_test.go index c8c775cf48eb..e68950b184f6 100644 --- a/internal/services/maintenance/public_maintenance_configurations_data_source_test.go +++ b/internal/services/maintenance/public_maintenance_configurations_data_source_test.go @@ -1,7 +1,6 @@ package maintenance_test import ( - "fmt" "testing" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" @@ -57,28 +56,28 @@ func TestAccDataSourcePublicMaintenanceConfigurations_recurEvery(t *testing.T) { } func (PublicMaintenanceConfigurationsDataSource) allFilters() string { - return fmt.Sprintf(` + return ` data "azurerm_public_maintenance_configurations" "test" { location = "West Europe" scope = "SQLManagedInstance" recur_every = "Monday-Thursday" } -`) +` } func (PublicMaintenanceConfigurationsDataSource) noFilters() string { - return fmt.Sprintf(` + return ` data "azurerm_public_maintenance_configurations" "test" { } -`) +` } func (PublicMaintenanceConfigurationsDataSource) recurEvery() string { - return fmt.Sprintf(` + return ` data "azurerm_public_maintenance_configurations" "test" { scope = "SQLManagedInstance" recur_every = "Friday-Sunday" } -`) +` } diff --git a/internal/services/managedapplications/client/client.go b/internal/services/managedapplications/client/client.go index 553b45281276..75ab9313e1f0 100644 --- a/internal/services/managedapplications/client/client.go +++ b/internal/services/managedapplications/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-07-01/managedapplications" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-07-01/managedapplications" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/managedapplications/managed_application_definition_resource.go b/internal/services/managedapplications/managed_application_definition_resource.go index 64b11e03a7f1..007eeb2292c3 100644 --- a/internal/services/managedapplications/managed_application_definition_resource.go +++ b/internal/services/managedapplications/managed_application_definition_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-07-01/managedapplications" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-07-01/managedapplications" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/managedapplications/managed_application_resource.go b/internal/services/managedapplications/managed_application_resource.go index 86bbb5ae1239..8ea51586068a 100644 --- a/internal/services/managedapplications/managed_application_resource.go +++ b/internal/services/managedapplications/managed_application_resource.go @@ -7,7 +7,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-07-01/managedapplications" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-07-01/managedapplications" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/managedidentity/federated_identity_credential_resource.go b/internal/services/managedidentity/federated_identity_credential_resource.go index 67cde27d5d8d..3a0c8e0e6400 100644 --- a/internal/services/managedidentity/federated_identity_credential_resource.go +++ b/internal/services/managedidentity/federated_identity_credential_resource.go @@ -102,9 +102,7 @@ func (r FederatedIdentityCredentialResource) Create() sdk.ResourceFunc { } var payload managedidentities.FederatedIdentityCredential - if err := r.mapFederatedIdentityCredentialResourceSchemaToFederatedIdentityCredential(config, &payload); err != nil { - return fmt.Errorf("mapping schema model to sdk model: %+v", err) - } + r.mapFederatedIdentityCredentialResourceSchemaToFederatedIdentityCredential(config, &payload) if _, err := client.FederatedIdentityCredentialsCreateOrUpdate(ctx, id, payload); err != nil { return fmt.Errorf("creating %s: %+v", id, err) @@ -140,9 +138,7 @@ func (r FederatedIdentityCredentialResource) Read() sdk.ResourceFunc { schema.ResourceGroupName = id.ResourceGroupName parentId := commonids.NewUserAssignedIdentityID(id.SubscriptionId, id.ResourceGroupName, id.ResourceName) schema.ResourceName = parentId.ID() - if err := r.mapFederatedIdentityCredentialToFederatedIdentityCredentialResourceSchema(*model, &schema); err != nil { - return fmt.Errorf("flattening model: %+v", err) - } + r.mapFederatedIdentityCredentialToFederatedIdentityCredentialResourceSchema(*model, &schema) } return metadata.Encode(&schema) @@ -169,52 +165,30 @@ func (r FederatedIdentityCredentialResource) Delete() sdk.ResourceFunc { } } -func (r FederatedIdentityCredentialResource) mapFederatedIdentityCredentialResourceSchemaToFederatedIdentityCredentialProperties(input FederatedIdentityCredentialResourceSchema, output *managedidentities.FederatedIdentityCredentialProperties) error { - - audiences := make([]string, 0) - for _, v := range input.Audience { - audiences = append(audiences, v) - } - output.Audiences = audiences - +func (r FederatedIdentityCredentialResource) mapFederatedIdentityCredentialResourceSchemaToFederatedIdentityCredentialProperties(input FederatedIdentityCredentialResourceSchema, output *managedidentities.FederatedIdentityCredentialProperties) { + output.Audiences = input.Audience output.Issuer = input.Issuer output.Subject = input.Subject - return nil } -func (r FederatedIdentityCredentialResource) mapFederatedIdentityCredentialPropertiesToFederatedIdentityCredentialResourceSchema(input managedidentities.FederatedIdentityCredentialProperties, output *FederatedIdentityCredentialResourceSchema) error { - - audiences := make([]string, 0) - for _, v := range input.Audiences { - audiences = append(audiences, v) - } - output.Audience = audiences - +func (r FederatedIdentityCredentialResource) mapFederatedIdentityCredentialPropertiesToFederatedIdentityCredentialResourceSchema(input managedidentities.FederatedIdentityCredentialProperties, output *FederatedIdentityCredentialResourceSchema) { + output.Audience = input.Audiences output.Issuer = input.Issuer output.Subject = input.Subject - return nil } -func (r FederatedIdentityCredentialResource) mapFederatedIdentityCredentialResourceSchemaToFederatedIdentityCredential(input FederatedIdentityCredentialResourceSchema, output *managedidentities.FederatedIdentityCredential) error { +func (r FederatedIdentityCredentialResource) mapFederatedIdentityCredentialResourceSchemaToFederatedIdentityCredential(input FederatedIdentityCredentialResourceSchema, output *managedidentities.FederatedIdentityCredential) { if output.Properties == nil { output.Properties = &managedidentities.FederatedIdentityCredentialProperties{} } - if err := r.mapFederatedIdentityCredentialResourceSchemaToFederatedIdentityCredentialProperties(input, output.Properties); err != nil { - return fmt.Errorf("mapping Schema to SDK Field %q / Model %q: %+v", "FederatedIdentityCredentialProperties", "Properties", err) - } - - return nil + r.mapFederatedIdentityCredentialResourceSchemaToFederatedIdentityCredentialProperties(input, output.Properties) } -func (r FederatedIdentityCredentialResource) mapFederatedIdentityCredentialToFederatedIdentityCredentialResourceSchema(input managedidentities.FederatedIdentityCredential, output *FederatedIdentityCredentialResourceSchema) error { +func (r FederatedIdentityCredentialResource) mapFederatedIdentityCredentialToFederatedIdentityCredentialResourceSchema(input managedidentities.FederatedIdentityCredential, output *FederatedIdentityCredentialResourceSchema) { if input.Properties == nil { input.Properties = &managedidentities.FederatedIdentityCredentialProperties{} } - if err := r.mapFederatedIdentityCredentialPropertiesToFederatedIdentityCredentialResourceSchema(*input.Properties, output); err != nil { - return fmt.Errorf("mapping SDK Field %q / Model %q to Schema: %+v", "FederatedIdentityCredentialProperties", "Properties", err) - } - - return nil + r.mapFederatedIdentityCredentialPropertiesToFederatedIdentityCredentialResourceSchema(*input.Properties, output) } diff --git a/internal/services/managementgroup/client/client.go b/internal/services/managementgroup/client/client.go index c5bd72f6631a..d6b9d056110b 100644 --- a/internal/services/managementgroup/client/client.go +++ b/internal/services/managementgroup/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-05-01/managementgroups" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-05-01/managementgroups" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/managementgroup/management_group_data_source.go b/internal/services/managementgroup/management_group_data_source.go index 88b0de7ee328..19492a3c43e7 100644 --- a/internal/services/managementgroup/management_group_data_source.go +++ b/internal/services/managementgroup/management_group_data_source.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-05-01/managementgroups" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-05-01/managementgroups" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/managementgroup/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/managementgroup/validate" diff --git a/internal/services/managementgroup/management_group_resource.go b/internal/services/managementgroup/management_group_resource.go index a1e4e3545c7b..4d760d83ef7b 100644 --- a/internal/services/managementgroup/management_group_resource.go +++ b/internal/services/managementgroup/management_group_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-05-01/managementgroups" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-05-01/managementgroups" // nolint: staticcheck "github.com/google/uuid" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/managementgroup/subscription_association_resource.go b/internal/services/managementgroup/subscription_association_resource.go index ba6f8e0c4ac2..b632af6af74d 100644 --- a/internal/services/managementgroup/subscription_association_resource.go +++ b/internal/services/managementgroup/subscription_association_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-05-01/managementgroups" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-05-01/managementgroups" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/managementgroup/subscription_association_resource_test.go b/internal/services/managementgroup/subscription_association_resource_test.go index bb3b98cd4ea2..28a2a77db27c 100644 --- a/internal/services/managementgroup/subscription_association_resource_test.go +++ b/internal/services/managementgroup/subscription_association_resource_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-05-01/managementgroups" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-05-01/managementgroups" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/media/client/client.go b/internal/services/media/client/client.go index 48f9f1f6f6bb..47aafab54e05 100644 --- a/internal/services/media/client/client.go +++ b/internal/services/media/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media" + "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/media/media_asset_filter_resource.go b/internal/services/media/media_asset_filter_resource.go index 8e4be49021d3..9314f72c8c20 100644 --- a/internal/services/media/media_asset_filter_resource.go +++ b/internal/services/media/media_asset_filter_resource.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media" + "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -141,7 +141,7 @@ func resourceMediaAssetFilter() *pluginsdk.Resource { Optional: true, Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ - //lintignore:XS003 + // lintignore:XS003 "condition": { Type: pluginsdk.TypeList, Required: true, diff --git a/internal/services/media/media_asset_resource.go b/internal/services/media/media_asset_resource.go index 9d76e8b4220b..a1ad570a592d 100644 --- a/internal/services/media/media_asset_resource.go +++ b/internal/services/media/media_asset_resource.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media" + "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/media/media_content_key_policy_resource.go b/internal/services/media/media_content_key_policy_resource.go index 3b81c73e24f7..6997cebf73ea 100644 --- a/internal/services/media/media_content_key_policy_resource.go +++ b/internal/services/media/media_content_key_policy_resource.go @@ -8,7 +8,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media" + "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/gofrs/uuid" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" @@ -90,7 +90,7 @@ func resourceMediaContentKeyPolicy() *pluginsdk.Resource { ValidateFunc: validation.StringIsNotEmpty, }, - //lintignore:XS003 + // lintignore:XS003 "playready_configuration_license": { Type: pluginsdk.TypeList, Optional: true, @@ -150,7 +150,7 @@ func resourceMediaContentKeyPolicy() *pluginsdk.Resource { }, false), }, - //lintignore:XS003 + // lintignore:XS003 "play_right": { Type: pluginsdk.TypeList, Optional: true, @@ -240,7 +240,7 @@ func resourceMediaContentKeyPolicy() *pluginsdk.Resource { }, }, }, - //lintignore:XS003 + // lintignore:XS003 "fairplay_configuration": { Type: pluginsdk.TypeList, Optional: true, @@ -265,7 +265,7 @@ func resourceMediaContentKeyPolicy() *pluginsdk.Resource { Sensitive: true, ValidateFunc: validation.StringIsNotEmpty, }, - //lintignore:XS003 + // lintignore:XS003 "offline_rental_configuration": { Type: pluginsdk.TypeList, Optional: true, @@ -303,7 +303,7 @@ func resourceMediaContentKeyPolicy() *pluginsdk.Resource { }, }, }, - //lintignore:XS003 + // lintignore:XS003 "token_restriction": { Type: pluginsdk.TypeList, Optional: true, @@ -357,7 +357,7 @@ func resourceMediaContentKeyPolicy() *pluginsdk.Resource { Optional: true, ValidateFunc: validation.StringIsNotEmpty, }, - //lintignore:XS003 + // lintignore:XS003 "required_claim": { Type: pluginsdk.TypeList, Optional: true, diff --git a/internal/services/media/media_job_resource.go b/internal/services/media/media_job_resource.go index fc2d8769c52a..632105180864 100644 --- a/internal/services/media/media_job_resource.go +++ b/internal/services/media/media_job_resource.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media" + "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/media/media_live_output_resource.go b/internal/services/media/media_live_output_resource.go index 4ccd68bfc5ba..ad6952797dea 100644 --- a/internal/services/media/media_live_output_resource.go +++ b/internal/services/media/media_live_output_resource.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media" + "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/media/media_services_account_resource.go b/internal/services/media/media_services_account_resource.go index 4b825dc4b0e8..6363231f3cc8 100644 --- a/internal/services/media/media_services_account_resource.go +++ b/internal/services/media/media_services_account_resource.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media" + "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/internal/services/media/media_streaming_endpoint_resource.go b/internal/services/media/media_streaming_endpoint_resource.go index 2e8d09621a3e..e150f82671f3 100644 --- a/internal/services/media/media_streaming_endpoint_resource.go +++ b/internal/services/media/media_streaming_endpoint_resource.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media" + "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" @@ -77,7 +77,7 @@ func resourceMediaStreamingEndpoint() *pluginsdk.Resource { MaxItems: 1, Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ - //lintignore:XS003 + // lintignore:XS003 "akamai_signature_header_authentication_key": { Type: pluginsdk.TypeList, Optional: true, @@ -102,7 +102,7 @@ func resourceMediaStreamingEndpoint() *pluginsdk.Resource { }, AtLeastOneOf: []string{"access_control.0.akamai_signature_header_authentication_key", "access_control.0.ip_allow"}, }, - //lintignore:XS003 + // lintignore:XS003 "ip_allow": { Type: pluginsdk.TypeList, Optional: true, diff --git a/internal/services/media/media_streaming_live_event_resource.go b/internal/services/media/media_streaming_live_event_resource.go index 352ae23d3986..891553df702f 100644 --- a/internal/services/media/media_streaming_live_event_resource.go +++ b/internal/services/media/media_streaming_live_event_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media" + "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -69,7 +69,7 @@ func resourceMediaLiveEvent() *pluginsdk.Resource { MaxItems: 1, Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ - //lintignore:XS003 + // lintignore:XS003 "ip_access_control_allow": { Type: pluginsdk.TypeList, Optional: true, @@ -242,7 +242,7 @@ func resourceMediaLiveEvent() *pluginsdk.Resource { MaxItems: 1, Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ - //lintignore:XS003 + // lintignore:XS003 "ip_access_control_allow": { Type: pluginsdk.TypeList, Optional: true, diff --git a/internal/services/media/media_streaming_locator_resource.go b/internal/services/media/media_streaming_locator_resource.go index 1adeae3ced0a..519725fbdb3b 100644 --- a/internal/services/media/media_streaming_locator_resource.go +++ b/internal/services/media/media_streaming_locator_resource.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media" + "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/gofrs/uuid" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" @@ -81,7 +81,7 @@ func resourceMediaStreamingLocator() *pluginsdk.Resource { ValidateFunc: validation.StringIsNotEmpty, }, - //lintignore:XS003 + // lintignore:XS003 "content_key": { Type: pluginsdk.TypeList, Optional: true, diff --git a/internal/services/media/media_streaming_policy_resource.go b/internal/services/media/media_streaming_policy_resource.go index b2023fa69333..86587b4e029b 100644 --- a/internal/services/media/media_streaming_policy_resource.go +++ b/internal/services/media/media_streaming_policy_resource.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media" + "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -267,7 +267,7 @@ func resourceMediaStreamingPolicyDelete(d *pluginsdk.ResourceData, meta interfac } func enabledProtocolsSchema() *pluginsdk.Schema { - //lintignore:XS003 + // lintignore:XS003 return &pluginsdk.Schema{ Type: pluginsdk.TypeList, Optional: true, @@ -304,7 +304,7 @@ func enabledProtocolsSchema() *pluginsdk.Schema { } func defaultContentKeySchema() *pluginsdk.Schema { - //lintignore:XS003 + // lintignore:XS003 return &pluginsdk.Schema{ Type: pluginsdk.TypeList, Optional: true, diff --git a/internal/services/media/media_transform_resource.go b/internal/services/media/media_transform_resource.go index 61aef365fb73..3d7527d27e2f 100644 --- a/internal/services/media/media_transform_resource.go +++ b/internal/services/media/media_transform_resource.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media" + "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -66,7 +66,7 @@ func resourceMediaTransform() *pluginsdk.Resource { ValidateFunc: validation.StringIsNotEmpty, }, - //lintignore:XS003 + // lintignore:XS003 "output": { Type: pluginsdk.TypeList, Optional: true, @@ -81,7 +81,7 @@ func resourceMediaTransform() *pluginsdk.Resource { string(media.OnErrorTypeStopProcessingJob), }, false), }, - //lintignore:XS003 + // lintignore:XS003 "builtin_preset": { Type: pluginsdk.TypeList, Optional: true, @@ -108,7 +108,7 @@ func resourceMediaTransform() *pluginsdk.Resource { }, }, }, - //lintignore:XS003 + // lintignore:XS003 "audio_analyzer_preset": { Type: pluginsdk.TypeList, Optional: true, @@ -148,7 +148,7 @@ func resourceMediaTransform() *pluginsdk.Resource { }, }, }, - //lintignore:XS003 + // lintignore:XS003 "video_analyzer_preset": { Type: pluginsdk.TypeList, Optional: true, @@ -197,7 +197,7 @@ func resourceMediaTransform() *pluginsdk.Resource { }, }, }, - //lintignore:XS003 + // lintignore:XS003 "face_detector_preset": { Type: pluginsdk.TypeList, Optional: true, diff --git a/internal/services/monitor/action_rule.go b/internal/services/monitor/action_rule.go index 207d019d7a5d..d1221c224d72 100644 --- a/internal/services/monitor/action_rule.go +++ b/internal/services/monitor/action_rule.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/Azure/azure-sdk-for-go/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement" + "github.com/Azure/azure-sdk-for-go/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/monitor/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/monitor/alert_processing_rule.go b/internal/services/monitor/alert_processing_rule.go index 0aaac95df897..93f176ceea15 100644 --- a/internal/services/monitor/alert_processing_rule.go +++ b/internal/services/monitor/alert_processing_rule.go @@ -420,7 +420,6 @@ func expandAlertProcessingRuleSingleConditions(input []AlertProcessingRuleSingle Values: &values, }) } - return } func expandAlertProcessingRuleSchedule(input []AlertProcessingRuleScheduleModel) *alertprocessingrules.Schedule { diff --git a/internal/services/monitor/client/client.go b/internal/services/monitor/client/client.go index 1653ad619ff0..4bc33617c524 100644 --- a/internal/services/monitor/client/client.go +++ b/internal/services/monitor/client/client.go @@ -1,11 +1,11 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/aad/mgmt/2017-04-01/aad" - "github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2020-10-01/insights" - "github.com/Azure/azure-sdk-for-go/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement" - classic "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" - newActionGroupClient "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-09-01-preview/insights" + "github.com/Azure/azure-sdk-for-go/services/aad/mgmt/2017-04-01/aad" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2020-10-01/insights" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement" // nolint: staticcheck + classic "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" // nolint: staticcheck + newActionGroupClient "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-09-01-preview/insights" // nolint: staticcheck "github.com/hashicorp/go-azure-sdk/resource-manager/alertsmanagement/2021-08-08/alertprocessingrules" "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-04-01/datacollectionendpoints" "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-04-01/datacollectionruleassociations" diff --git a/internal/services/monitor/common_monitor.go b/internal/services/monitor/common_monitor.go index b9e9d648d0bf..c51759b3150d 100644 --- a/internal/services/monitor/common_monitor.go +++ b/internal/services/monitor/common_monitor.go @@ -1,7 +1,7 @@ package monitor import ( - "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" + "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/monitor/monitor_aad_diagnostic_setting_resource.go b/internal/services/monitor/monitor_aad_diagnostic_setting_resource.go index e136a2297adf..05dc2652c364 100644 --- a/internal/services/monitor/monitor_aad_diagnostic_setting_resource.go +++ b/internal/services/monitor/monitor_aad_diagnostic_setting_resource.go @@ -7,7 +7,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/aad/mgmt/2017-04-01/aad" + "github.com/Azure/azure-sdk-for-go/services/aad/mgmt/2017-04-01/aad" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" authRuleParse "github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/authorizationrulesnamespaces" "github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2020-08-01/workspaces" diff --git a/internal/services/monitor/monitor_action_group_resource.go b/internal/services/monitor/monitor_action_group_resource.go index faa7117ce9a6..18931e02bc57 100644 --- a/internal/services/monitor/monitor_action_group_resource.go +++ b/internal/services/monitor/monitor_action_group_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-09-01-preview/insights" + "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-09-01-preview/insights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/monitor/monitor_action_rule_action_group_resource.go b/internal/services/monitor/monitor_action_rule_action_group_resource.go index 326026fd426a..5e6ea990b7ca 100644 --- a/internal/services/monitor/monitor_action_rule_action_group_resource.go +++ b/internal/services/monitor/monitor_action_rule_action_group_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement" + "github.com/Azure/azure-sdk-for-go/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/monitor/monitor_action_rule_suppression_resource.go b/internal/services/monitor/monitor_action_rule_suppression_resource.go index f87413a3c0b4..ca55cc36668b 100644 --- a/internal/services/monitor/monitor_action_rule_suppression_resource.go +++ b/internal/services/monitor/monitor_action_rule_suppression_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement" + "github.com/Azure/azure-sdk-for-go/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/monitor/monitor_activity_log_alert_resource.go b/internal/services/monitor/monitor_activity_log_alert_resource.go index f8c7909dac5e..643c8761dbf4 100644 --- a/internal/services/monitor/monitor_activity_log_alert_resource.go +++ b/internal/services/monitor/monitor_activity_log_alert_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2020-10-01/insights" + "github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2020-10-01/insights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" @@ -160,7 +160,7 @@ func resourceMonitorActivityLogAlert() *pluginsdk.Resource { Optional: true, ConflictsWith: []string{"criteria.0.recommendation_category", "criteria.0.recommendation_impact"}, }, - //lintignore:XS003 + // lintignore:XS003 "resource_health": { Type: pluginsdk.TypeList, Computed: true, @@ -218,7 +218,7 @@ func resourceMonitorActivityLogAlert() *pluginsdk.Resource { }, ConflictsWith: []string{"criteria.0.recommendation_category", "criteria.0.recommendation_impact", "criteria.0.status", "criteria.0.sub_status", "criteria.0.recommendation_impact", "criteria.0.resource_provider", "criteria.0.resource_type", "criteria.0.operation_name", "criteria.0.caller", "criteria.0.operation_name", "criteria.0.service_health"}, }, - //lintignore:XS003 + // lintignore:XS003 "service_health": { Type: pluginsdk.TypeList, Computed: true, diff --git a/internal/services/monitor/monitor_autoscale_setting_resource.go b/internal/services/monitor/monitor_autoscale_setting_resource.go index dfb649564828..7684a7e8cead 100644 --- a/internal/services/monitor/monitor_autoscale_setting_resource.go +++ b/internal/services/monitor/monitor_autoscale_setting_resource.go @@ -6,7 +6,7 @@ import ( "strconv" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" + "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" diff --git a/internal/services/monitor/monitor_diagnostic_categories_data_source.go b/internal/services/monitor/monitor_diagnostic_categories_data_source.go index 6bf806fa63f2..88f75bd52ad6 100644 --- a/internal/services/monitor/monitor_diagnostic_categories_data_source.go +++ b/internal/services/monitor/monitor_diagnostic_categories_data_source.go @@ -102,9 +102,7 @@ func dataSourceMonitorDiagnosticCategoriesRead(d *pluginsdk.ResourceData, meta i if category := v.Properties; category != nil { if category.CategoryGroups != nil { - for _, item := range *category.CategoryGroups { - categoryGroups = append(categoryGroups, item) - } + categoryGroups = append(categoryGroups, *category.CategoryGroups...) } if category.CategoryType != nil { switch *category.CategoryType { diff --git a/internal/services/monitor/monitor_log_profile_resource.go b/internal/services/monitor/monitor_log_profile_resource.go index 96fcdc657f2c..27a83fa98da0 100644 --- a/internal/services/monitor/monitor_log_profile_resource.go +++ b/internal/services/monitor/monitor_log_profile_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" + "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/monitor/monitor_metric_alert_resource.go b/internal/services/monitor/monitor_metric_alert_resource.go index 1d5ad29890b3..c8ccdf5af87e 100644 --- a/internal/services/monitor/monitor_metric_alert_resource.go +++ b/internal/services/monitor/monitor_metric_alert_resource.go @@ -8,7 +8,7 @@ import ( "strconv" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" + "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" @@ -171,7 +171,7 @@ func resourceMonitorMetricAlert() *pluginsdk.Resource { }, }, - //lintignore: S018 + // lintignore: S018 "dynamic_criteria": { Type: pluginsdk.TypeList, Optional: true, @@ -544,7 +544,7 @@ func resourceMonitorMetricAlertRead(d *pluginsdk.ResourceData, meta interface{}) } monitorMetricAlertCriteria := flattenMonitorMetricAlertCriteria(alert.Criteria) - //lintignore:R001 + // lintignore:R001 if err := d.Set(criteriaSchema, monitorMetricAlertCriteria); err != nil { return fmt.Errorf("failed setting `%s`: %+v", criteriaSchema, err) } diff --git a/internal/services/monitor/monitor_private_link_scope_resource.go b/internal/services/monitor/monitor_private_link_scope_resource.go index 62e59df2d9a5..63c42a5475bd 100644 --- a/internal/services/monitor/monitor_private_link_scope_resource.go +++ b/internal/services/monitor/monitor_private_link_scope_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" + "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/monitor/monitor_private_link_scoped_service_resource.go b/internal/services/monitor/monitor_private_link_scoped_service_resource.go index 0eccd9fcff6f..abd4331278c6 100644 --- a/internal/services/monitor/monitor_private_link_scoped_service_resource.go +++ b/internal/services/monitor/monitor_private_link_scoped_service_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" + "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-04-01/datacollectionendpoints" "github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2020-08-01/workspaces" diff --git a/internal/services/monitor/monitor_scheduled_query_rules_alert_data_source.go b/internal/services/monitor/monitor_scheduled_query_rules_alert_data_source.go index de0dadf962dc..4e734fae79c1 100644 --- a/internal/services/monitor/monitor_scheduled_query_rules_alert_data_source.go +++ b/internal/services/monitor/monitor_scheduled_query_rules_alert_data_source.go @@ -5,7 +5,7 @@ import ( "strconv" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" + "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/monitor/monitor_scheduled_query_rules_alert_resource.go b/internal/services/monitor/monitor_scheduled_query_rules_alert_resource.go index e72ed9b6f05a..4135e6bb5e19 100644 --- a/internal/services/monitor/monitor_scheduled_query_rules_alert_resource.go +++ b/internal/services/monitor/monitor_scheduled_query_rules_alert_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" + "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/monitor/monitor_scheduled_query_rules_alert_v2_resource.go b/internal/services/monitor/monitor_scheduled_query_rules_alert_v2_resource.go index 855635a12d32..0238caeab15d 100644 --- a/internal/services/monitor/monitor_scheduled_query_rules_alert_v2_resource.go +++ b/internal/services/monitor/monitor_scheduled_query_rules_alert_v2_resource.go @@ -437,19 +437,9 @@ func (r ScheduledQueryRulesAlertV2Resource) Create() sdk.ResourceFunc { Tags: &model.Tags, } - actionsValue, err := expandScheduledQueryRulesAlertV2ActionsModel(model.Actions) - if err != nil { - return err - } - - properties.Properties.Actions = actionsValue - - criteriaValue, err := expandScheduledQueryRulesAlertV2CriteriaModel(model.Criteria) - if err != nil { - return err - } + properties.Properties.Actions = expandScheduledQueryRulesAlertV2ActionsModel(model.Actions) - properties.Properties.Criteria = criteriaValue + properties.Properties.Criteria = expandScheduledQueryRulesAlertV2CriteriaModel(model.Criteria) if model.Description != "" { properties.Properties.Description = &model.Description @@ -515,12 +505,7 @@ func (r ScheduledQueryRulesAlertV2Resource) Update() sdk.ResourceFunc { } if metadata.ResourceData.HasChange("action") { - actionsValue, err := expandScheduledQueryRulesAlertV2ActionsModel(resourceModel.Actions) - if err != nil { - return err - } - - model.Properties.Actions = actionsValue + model.Properties.Actions = expandScheduledQueryRulesAlertV2ActionsModel(resourceModel.Actions) } if metadata.ResourceData.HasChange("auto_mitigation_enabled") { @@ -532,12 +517,7 @@ func (r ScheduledQueryRulesAlertV2Resource) Update() sdk.ResourceFunc { } if metadata.ResourceData.HasChange("criteria") { - criteriaValue, err := expandScheduledQueryRulesAlertV2CriteriaModel(resourceModel.Criteria) - if err != nil { - return err - } - - model.Properties.Criteria = criteriaValue + model.Properties.Criteria = expandScheduledQueryRulesAlertV2CriteriaModel(resourceModel.Criteria) } if metadata.ResourceData.HasChange("description") { @@ -646,12 +626,7 @@ func (r ScheduledQueryRulesAlertV2Resource) Read() sdk.ResourceFunc { } properties := &model.Properties - actionsValue, err := flattenScheduledQueryRulesAlertV2ActionsModel(properties.Actions) - if err != nil { - return err - } - - state.Actions = actionsValue + state.Actions = flattenScheduledQueryRulesAlertV2ActionsModel(properties.Actions) if properties.AutoMitigate != nil { state.AutoMitigate = *properties.AutoMitigate @@ -665,12 +640,7 @@ func (r ScheduledQueryRulesAlertV2Resource) Read() sdk.ResourceFunc { state.CreatedWithApiVersion = *properties.CreatedWithApiVersion } - criteriaValue, err := flattenScheduledQueryRulesAlertV2CriteriaModel(properties.Criteria) - if err != nil { - return err - } - - state.Criteria = criteriaValue + state.Criteria = flattenScheduledQueryRulesAlertV2CriteriaModel(properties.Criteria) if properties.Description != nil { state.Description = *properties.Description @@ -752,9 +722,9 @@ func (r ScheduledQueryRulesAlertV2Resource) Delete() sdk.ResourceFunc { } } -func expandScheduledQueryRulesAlertV2ActionsModel(inputList []ScheduledQueryRulesAlertV2ActionsModel) (*scheduledqueryrules.Actions, error) { +func expandScheduledQueryRulesAlertV2ActionsModel(inputList []ScheduledQueryRulesAlertV2ActionsModel) *scheduledqueryrules.Actions { if len(inputList) == 0 { - return nil, nil + return nil } input := &inputList[0] @@ -763,10 +733,10 @@ func expandScheduledQueryRulesAlertV2ActionsModel(inputList []ScheduledQueryRule CustomProperties: &input.CustomProperties, } - return &output, nil + return &output } -func expandScheduledQueryRulesAlertV2CriteriaModel(inputList []ScheduledQueryRulesAlertV2CriteriaModel) (*scheduledqueryrules.ScheduledQueryRuleCriteria, error) { +func expandScheduledQueryRulesAlertV2CriteriaModel(inputList []ScheduledQueryRulesAlertV2CriteriaModel) *scheduledqueryrules.ScheduledQueryRuleCriteria { output := scheduledqueryrules.ScheduledQueryRuleCriteria{} var outputList []scheduledqueryrules.Condition for _, v := range inputList { @@ -777,19 +747,8 @@ func expandScheduledQueryRulesAlertV2CriteriaModel(inputList []ScheduledQueryRul TimeAggregation: &input.TimeAggregation, } - dimensionsValue, err := expandScheduledQueryRulesAlertV2DimensionModel(input.Dimensions) - if err != nil { - return nil, err - } - - condition.Dimensions = dimensionsValue - - failingPeriodsValue, err := expandScheduledQueryRulesAlertV2FailingPeriodsModel(input.FailingPeriods) - if err != nil { - return nil, err - } - - condition.FailingPeriods = failingPeriodsValue + condition.Dimensions = expandScheduledQueryRulesAlertV2DimensionModel(input.Dimensions) + condition.FailingPeriods = expandScheduledQueryRulesAlertV2FailingPeriodsModel(input.FailingPeriods) if input.MetricMeasureColumn != "" { condition.MetricMeasureColumn = &input.MetricMeasureColumn @@ -806,10 +765,10 @@ func expandScheduledQueryRulesAlertV2CriteriaModel(inputList []ScheduledQueryRul outputList = append(outputList, condition) } output.AllOf = &outputList - return &output, nil + return &output } -func expandScheduledQueryRulesAlertV2DimensionModel(inputList []ScheduledQueryRulesAlertV2DimensionModel) (*[]scheduledqueryrules.Dimension, error) { +func expandScheduledQueryRulesAlertV2DimensionModel(inputList []ScheduledQueryRulesAlertV2DimensionModel) *[]scheduledqueryrules.Dimension { var outputList []scheduledqueryrules.Dimension for _, v := range inputList { input := v @@ -822,12 +781,12 @@ func expandScheduledQueryRulesAlertV2DimensionModel(inputList []ScheduledQueryRu outputList = append(outputList, output) } - return &outputList, nil + return &outputList } -func expandScheduledQueryRulesAlertV2FailingPeriodsModel(inputList []ScheduledQueryRulesAlertV2FailingPeriodsModel) (*scheduledqueryrules.ConditionFailingPeriods, error) { +func expandScheduledQueryRulesAlertV2FailingPeriodsModel(inputList []ScheduledQueryRulesAlertV2FailingPeriodsModel) *scheduledqueryrules.ConditionFailingPeriods { if len(inputList) == 0 { - return nil, nil + return nil } input := &inputList[0] @@ -836,13 +795,13 @@ func expandScheduledQueryRulesAlertV2FailingPeriodsModel(inputList []ScheduledQu NumberOfEvaluationPeriods: &input.NumberOfEvaluationPeriods, } - return &output, nil + return &output } -func flattenScheduledQueryRulesAlertV2ActionsModel(input *scheduledqueryrules.Actions) ([]ScheduledQueryRulesAlertV2ActionsModel, error) { +func flattenScheduledQueryRulesAlertV2ActionsModel(input *scheduledqueryrules.Actions) []ScheduledQueryRulesAlertV2ActionsModel { var outputList []ScheduledQueryRulesAlertV2ActionsModel if input == nil { - return outputList, nil + return outputList } output := ScheduledQueryRulesAlertV2ActionsModel{} @@ -855,36 +814,25 @@ func flattenScheduledQueryRulesAlertV2ActionsModel(input *scheduledqueryrules.Ac output.CustomProperties = *input.CustomProperties } - return append(outputList, output), nil + return append(outputList, output) } -func flattenScheduledQueryRulesAlertV2CriteriaModel(input *scheduledqueryrules.ScheduledQueryRuleCriteria) ([]ScheduledQueryRulesAlertV2CriteriaModel, error) { +func flattenScheduledQueryRulesAlertV2CriteriaModel(input *scheduledqueryrules.ScheduledQueryRuleCriteria) []ScheduledQueryRulesAlertV2CriteriaModel { var outputList []ScheduledQueryRulesAlertV2CriteriaModel if input == nil { - return outputList, nil + return outputList } inputList := input.AllOf if inputList == nil { - return outputList, nil + return outputList } for _, v := range *inputList { output := ScheduledQueryRulesAlertV2CriteriaModel{} - dimensionsValue, err := flattenScheduledQueryRulesAlertV2DimensionModel(v.Dimensions) - if err != nil { - return nil, err - } - - output.Dimensions = dimensionsValue - - failingPeriodsValue, err := flattenScheduledQueryRulesAlertV2FailingPeriodsModel(v.FailingPeriods) - if err != nil { - return nil, err - } - - output.FailingPeriods = failingPeriodsValue + output.Dimensions = flattenScheduledQueryRulesAlertV2DimensionModel(v.Dimensions) + output.FailingPeriods = flattenScheduledQueryRulesAlertV2FailingPeriodsModel(v.FailingPeriods) if v.MetricMeasureColumn != nil { output.MetricMeasureColumn = *v.MetricMeasureColumn @@ -913,13 +861,13 @@ func flattenScheduledQueryRulesAlertV2CriteriaModel(input *scheduledqueryrules.S outputList = append(outputList, output) } - return outputList, nil + return outputList } -func flattenScheduledQueryRulesAlertV2DimensionModel(inputList *[]scheduledqueryrules.Dimension) ([]ScheduledQueryRulesAlertV2DimensionModel, error) { +func flattenScheduledQueryRulesAlertV2DimensionModel(inputList *[]scheduledqueryrules.Dimension) []ScheduledQueryRulesAlertV2DimensionModel { var outputList []ScheduledQueryRulesAlertV2DimensionModel if inputList == nil { - return outputList, nil + return outputList } for _, input := range *inputList { @@ -932,13 +880,13 @@ func flattenScheduledQueryRulesAlertV2DimensionModel(inputList *[]scheduledquery outputList = append(outputList, output) } - return outputList, nil + return outputList } -func flattenScheduledQueryRulesAlertV2FailingPeriodsModel(input *scheduledqueryrules.ConditionFailingPeriods) ([]ScheduledQueryRulesAlertV2FailingPeriodsModel, error) { +func flattenScheduledQueryRulesAlertV2FailingPeriodsModel(input *scheduledqueryrules.ConditionFailingPeriods) []ScheduledQueryRulesAlertV2FailingPeriodsModel { var outputList []ScheduledQueryRulesAlertV2FailingPeriodsModel if input == nil { - return outputList, nil + return outputList } output := ScheduledQueryRulesAlertV2FailingPeriodsModel{} @@ -951,5 +899,5 @@ func flattenScheduledQueryRulesAlertV2FailingPeriodsModel(input *scheduledqueryr output.NumberOfEvaluationPeriods = *input.NumberOfEvaluationPeriods } - return append(outputList, output), nil + return append(outputList, output) } diff --git a/internal/services/monitor/monitor_scheduled_query_rules_log_data_source.go b/internal/services/monitor/monitor_scheduled_query_rules_log_data_source.go index 09dd2c5fb2cc..1c1b0bf45087 100644 --- a/internal/services/monitor/monitor_scheduled_query_rules_log_data_source.go +++ b/internal/services/monitor/monitor_scheduled_query_rules_log_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" + "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/monitor/monitor_scheduled_query_rules_log_resource.go b/internal/services/monitor/monitor_scheduled_query_rules_log_resource.go index 67240b94520c..9dbbd742f5de 100644 --- a/internal/services/monitor/monitor_scheduled_query_rules_log_resource.go +++ b/internal/services/monitor/monitor_scheduled_query_rules_log_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" + "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/monitor/monitor_smart_detector_alert_rule_resource.go b/internal/services/monitor/monitor_smart_detector_alert_rule_resource.go index cc3f1b76e7ee..e9c23f46d52b 100644 --- a/internal/services/monitor/monitor_smart_detector_alert_rule_resource.go +++ b/internal/services/monitor/monitor_smart_detector_alert_rule_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement" + "github.com/Azure/azure-sdk-for-go/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/mssql/client/client.go b/internal/services/mssql/client/client.go index 4dfdf699a0db..ea926bfbc65d 100644 --- a/internal/services/mssql/client/client.go +++ b/internal/services/mssql/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/go-azure-sdk/resource-manager/sqlvirtualmachine/2022-02-01/sqlvirtualmachines" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/mssql/helper/database.go b/internal/services/mssql/helper/database.go index e407d2ff9760..7a202214aa58 100644 --- a/internal/services/mssql/helper/database.go +++ b/internal/services/mssql/helper/database.go @@ -5,8 +5,8 @@ import ( "fmt" "log" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mssql/parse" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/mssql/helper/sql_extended_auditing.go b/internal/services/mssql/helper/sql_extended_auditing.go index 653c920e512f..5dcff3d990e7 100644 --- a/internal/services/mssql/helper/sql_extended_auditing.go +++ b/internal/services/mssql/helper/sql_extended_auditing.go @@ -1,7 +1,7 @@ package helper import ( - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/mssql/helper/sql_retention_policies.go b/internal/services/mssql/helper/sql_retention_policies.go index 8ba311492477..90593971df7b 100644 --- a/internal/services/mssql/helper/sql_retention_policies.go +++ b/internal/services/mssql/helper/sql_retention_policies.go @@ -1,7 +1,7 @@ package helper import ( - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" diff --git a/internal/services/mssql/mssql_database_data_source.go b/internal/services/mssql/mssql_database_data_source.go index 9c9c3a6e3365..3cf74b39e6b3 100644 --- a/internal/services/mssql/mssql_database_data_source.go +++ b/internal/services/mssql/mssql_database_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mssql/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mssql/validate" diff --git a/internal/services/mssql/mssql_database_extended_auditing_policy_resource.go b/internal/services/mssql/mssql_database_extended_auditing_policy_resource.go index 43a67a7066d8..5bd2045ab812 100644 --- a/internal/services/mssql/mssql_database_extended_auditing_policy_resource.go +++ b/internal/services/mssql/mssql_database_extended_auditing_policy_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mssql/parse" diff --git a/internal/services/mssql/mssql_database_resource.go b/internal/services/mssql/mssql_database_resource.go index 3971b321434d..556db42995e2 100644 --- a/internal/services/mssql/mssql_database_resource.go +++ b/internal/services/mssql/mssql_database_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/go-azure-sdk/resource-manager/maintenance/2021-05-01/publicmaintenanceconfigurations" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" diff --git a/internal/services/mssql/mssql_database_vulnerability_assessment_rule_baseline_resource.go b/internal/services/mssql/mssql_database_vulnerability_assessment_rule_baseline_resource.go index 02ff7ea5e07d..dca017ba7991 100644 --- a/internal/services/mssql/mssql_database_vulnerability_assessment_rule_baseline_resource.go +++ b/internal/services/mssql/mssql_database_vulnerability_assessment_rule_baseline_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mssql/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mssql/validate" diff --git a/internal/services/mssql/mssql_database_vulnerability_assessment_rule_baseline_resource_test.go b/internal/services/mssql/mssql_database_vulnerability_assessment_rule_baseline_resource_test.go index eedfd20fdd68..40fcf5c64c0e 100644 --- a/internal/services/mssql/mssql_database_vulnerability_assessment_rule_baseline_resource_test.go +++ b/internal/services/mssql/mssql_database_vulnerability_assessment_rule_baseline_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/mssql/mssql_elasticpool_resource.go b/internal/services/mssql/mssql_elasticpool_resource.go index 6b56fbfd88a8..d5af3ca6f0b2 100644 --- a/internal/services/mssql/mssql_elasticpool_resource.go +++ b/internal/services/mssql/mssql_elasticpool_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-sdk/resource-manager/maintenance/2021-05-01/publicmaintenanceconfigurations" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/mssql/mssql_failover_group_resource.go b/internal/services/mssql/mssql_failover_group_resource.go index c62e1a4120a8..09f743930fe6 100644 --- a/internal/services/mssql/mssql_failover_group_resource.go +++ b/internal/services/mssql/mssql_failover_group_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/mssql/mssql_firewall_rule_resource.go b/internal/services/mssql/mssql_firewall_rule_resource.go index d0eebc2b7361..30d4f1cd435f 100644 --- a/internal/services/mssql/mssql_firewall_rule_resource.go +++ b/internal/services/mssql/mssql_firewall_rule_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mssql/validate" diff --git a/internal/services/mssql/mssql_job_agent_resource.go b/internal/services/mssql/mssql_job_agent_resource.go index 58dddba4ebf0..7f9e426b7021 100644 --- a/internal/services/mssql/mssql_job_agent_resource.go +++ b/internal/services/mssql/mssql_job_agent_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/mssql/mssql_job_credential_resource.go b/internal/services/mssql/mssql_job_credential_resource.go index bd64c70c314d..9bfc3a87dda6 100644 --- a/internal/services/mssql/mssql_job_credential_resource.go +++ b/internal/services/mssql/mssql_job_credential_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mssql/parse" diff --git a/internal/services/mssql/mssql_managed_database_resource.go b/internal/services/mssql/mssql_managed_database_resource.go index 8e38fbd520a8..54424cac2b44 100644 --- a/internal/services/mssql/mssql_managed_database_resource.go +++ b/internal/services/mssql/mssql_managed_database_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mssql/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/services/sql/parse" diff --git a/internal/services/mssql/mssql_managed_instance_active_directory_administrator_resource.go b/internal/services/mssql/mssql_managed_instance_active_directory_administrator_resource.go index bb1e4a9d350c..64de4f86c412 100644 --- a/internal/services/mssql/mssql_managed_instance_active_directory_administrator_resource.go +++ b/internal/services/mssql/mssql_managed_instance_active_directory_administrator_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/gofrs/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" diff --git a/internal/services/mssql/mssql_managed_instance_data_source.go b/internal/services/mssql/mssql_managed_instance_data_source.go index 29c9e808174d..15187f8ac181 100644 --- a/internal/services/mssql/mssql_managed_instance_data_source.go +++ b/internal/services/mssql/mssql_managed_instance_data_source.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/mssql/mssql_managed_instance_failover_group_resource.go b/internal/services/mssql/mssql_managed_instance_failover_group_resource.go index 3bd074a31517..677022cf84a6 100644 --- a/internal/services/mssql/mssql_managed_instance_failover_group_resource.go +++ b/internal/services/mssql/mssql_managed_instance_failover_group_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" diff --git a/internal/services/mssql/mssql_managed_instance_resource.go b/internal/services/mssql/mssql_managed_instance_resource.go index 12554867254d..c5f1ad8876b0 100644 --- a/internal/services/mssql/mssql_managed_instance_resource.go +++ b/internal/services/mssql/mssql_managed_instance_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/internal/services/mssql/mssql_managed_instance_security_alert_policy_resource.go b/internal/services/mssql/mssql_managed_instance_security_alert_policy_resource.go index 51baba25e270..eb8c6f6c02e7 100644 --- a/internal/services/mssql/mssql_managed_instance_security_alert_policy_resource.go +++ b/internal/services/mssql/mssql_managed_instance_security_alert_policy_resource.go @@ -5,8 +5,8 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" - "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mssql/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mssql/validate" @@ -36,7 +36,7 @@ func resourceMsSqlManagedInstanceSecurityAlertPolicy() *pluginsdk.Resource { }, Schema: map[string]*pluginsdk.Schema{ - "resource_group_name": azure.SchemaResourceGroupName(), + "resource_group_name": commonschema.ResourceGroupName(), "managed_instance_name": { Type: pluginsdk.TypeString, diff --git a/internal/services/mssql/mssql_managed_instance_vulnerability_assessment_resource.go b/internal/services/mssql/mssql_managed_instance_vulnerability_assessment_resource.go index 740632d3db35..0e803f94b209 100644 --- a/internal/services/mssql/mssql_managed_instance_vulnerability_assessment_resource.go +++ b/internal/services/mssql/mssql_managed_instance_vulnerability_assessment_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mssql/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mssql/validate" diff --git a/internal/services/mssql/mssql_outbound_firewall_rule_resource.go b/internal/services/mssql/mssql_outbound_firewall_rule_resource.go index d6df2a8054f2..eb2dc0294772 100644 --- a/internal/services/mssql/mssql_outbound_firewall_rule_resource.go +++ b/internal/services/mssql/mssql_outbound_firewall_rule_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mssql/parse" diff --git a/internal/services/mssql/mssql_server_extended_auditing_policy_resource.go b/internal/services/mssql/mssql_server_extended_auditing_policy_resource.go index d02465a3810c..5b239ffe5026 100644 --- a/internal/services/mssql/mssql_server_extended_auditing_policy_resource.go +++ b/internal/services/mssql/mssql_server_extended_auditing_policy_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/gofrs/uuid" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/mssql/mssql_server_microsoft_support_auditing_policy_resource.go b/internal/services/mssql/mssql_server_microsoft_support_auditing_policy_resource.go index 5a426a2be047..6ddd2c32e52a 100644 --- a/internal/services/mssql/mssql_server_microsoft_support_auditing_policy_resource.go +++ b/internal/services/mssql/mssql_server_microsoft_support_auditing_policy_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/gofrs/uuid" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/mssql/mssql_server_resource.go b/internal/services/mssql/mssql_server_resource.go index 569fe9484d48..6e0ae27c3765 100644 --- a/internal/services/mssql/mssql_server_resource.go +++ b/internal/services/mssql/mssql_server_resource.go @@ -7,7 +7,7 @@ import ( "net/http" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/gofrs/uuid" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" diff --git a/internal/services/mssql/mssql_server_security_alert_policy_resource.go b/internal/services/mssql/mssql_server_security_alert_policy_resource.go index 75271a8493ae..c34613009dc4 100644 --- a/internal/services/mssql/mssql_server_security_alert_policy_resource.go +++ b/internal/services/mssql/mssql_server_security_alert_policy_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mssql/parse" diff --git a/internal/services/mssql/mssql_server_transparent_data_encryption_resource.go b/internal/services/mssql/mssql_server_transparent_data_encryption_resource.go index f22b57c8b19e..f336e02f1f74 100644 --- a/internal/services/mssql/mssql_server_transparent_data_encryption_resource.go +++ b/internal/services/mssql/mssql_server_transparent_data_encryption_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" keyVaultParser "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/parse" keyVaultValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/validate" diff --git a/internal/services/mssql/mssql_server_vulnerability_assessment_resource.go b/internal/services/mssql/mssql_server_vulnerability_assessment_resource.go index 5581f50750dc..5f6f4d3c00a8 100644 --- a/internal/services/mssql/mssql_server_vulnerability_assessment_resource.go +++ b/internal/services/mssql/mssql_server_vulnerability_assessment_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mssql/parse" diff --git a/internal/services/mssql/mssql_virtual_network_rule_resource.go b/internal/services/mssql/mssql_virtual_network_rule_resource.go index 0e621e3efb7a..b5afc0be11a4 100644 --- a/internal/services/mssql/mssql_virtual_network_rule_resource.go +++ b/internal/services/mssql/mssql_virtual_network_rule_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mssql/parse" diff --git a/internal/services/mysql/client/client.go b/internal/services/mysql/client/client.go index 8df03ed9ec0f..ffc151b57584 100644 --- a/internal/services/mysql/client/client.go +++ b/internal/services/mysql/client/client.go @@ -1,8 +1,8 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2020-01-01/mysql" - "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2021-05-01/mysqlflexibleservers" + "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2020-01-01/mysql" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2021-05-01/mysqlflexibleservers" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/mysql/mysql_aad_administrator_resource.go b/internal/services/mysql/mysql_aad_administrator_resource.go index efa82ff35c15..b45b52b900d9 100644 --- a/internal/services/mysql/mysql_aad_administrator_resource.go +++ b/internal/services/mysql/mysql_aad_administrator_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2020-01-01/mysql" + "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2020-01-01/mysql" // nolint: staticcheck "github.com/gofrs/uuid" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/mysql/mysql_configuration_resource.go b/internal/services/mysql/mysql_configuration_resource.go index 2854a14b7f18..5542e5c1dc39 100644 --- a/internal/services/mysql/mysql_configuration_resource.go +++ b/internal/services/mysql/mysql_configuration_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2020-01-01/mysql" + "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2020-01-01/mysql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mysql/parse" diff --git a/internal/services/mysql/mysql_database_resource.go b/internal/services/mysql/mysql_database_resource.go index b7293cb06d8b..4af8d9e69470 100644 --- a/internal/services/mysql/mysql_database_resource.go +++ b/internal/services/mysql/mysql_database_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2020-01-01/mysql" + "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2020-01-01/mysql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/mysql/mysql_firewall_rule_resource.go b/internal/services/mysql/mysql_firewall_rule_resource.go index f6b916874338..98d4408e50ad 100644 --- a/internal/services/mysql/mysql_firewall_rule_resource.go +++ b/internal/services/mysql/mysql_firewall_rule_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2020-01-01/mysql" + "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2020-01-01/mysql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" azValidate "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" diff --git a/internal/services/mysql/mysql_flexible_database_resource.go b/internal/services/mysql/mysql_flexible_database_resource.go index 828dc11bbc0d..70360314686f 100644 --- a/internal/services/mysql/mysql_flexible_database_resource.go +++ b/internal/services/mysql/mysql_flexible_database_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2021-05-01/mysqlflexibleservers" + "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2021-05-01/mysqlflexibleservers" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/mysql/mysql_flexible_server_configuration_resource.go b/internal/services/mysql/mysql_flexible_server_configuration_resource.go index 61c7c33be406..27db52045747 100644 --- a/internal/services/mysql/mysql_flexible_server_configuration_resource.go +++ b/internal/services/mysql/mysql_flexible_server_configuration_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2021-05-01/mysqlflexibleservers" + "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2021-05-01/mysqlflexibleservers" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mysql/parse" diff --git a/internal/services/mysql/mysql_flexible_server_data_source.go b/internal/services/mysql/mysql_flexible_server_data_source.go index 12849d083ecc..95c1edb18085 100644 --- a/internal/services/mysql/mysql_flexible_server_data_source.go +++ b/internal/services/mysql/mysql_flexible_server_data_source.go @@ -5,7 +5,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2021-05-01/mysqlflexibleservers" + "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2021-05-01/mysqlflexibleservers" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/mysql/mysql_flexible_server_firewall_rule_resource.go b/internal/services/mysql/mysql_flexible_server_firewall_rule_resource.go index 6ab060fc12f7..ab7e75fd4ce9 100644 --- a/internal/services/mysql/mysql_flexible_server_firewall_rule_resource.go +++ b/internal/services/mysql/mysql_flexible_server_firewall_rule_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2021-05-01/mysqlflexibleservers" + "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2021-05-01/mysqlflexibleservers" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" azValidate "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" diff --git a/internal/services/mysql/mysql_flexible_server_resource.go b/internal/services/mysql/mysql_flexible_server_resource.go index 24200a2656f3..11ad80f2523f 100644 --- a/internal/services/mysql/mysql_flexible_server_resource.go +++ b/internal/services/mysql/mysql_flexible_server_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2021-05-01/mysqlflexibleservers" + "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2021-05-01/mysqlflexibleservers" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/mysql/mysql_server_data_source.go b/internal/services/mysql/mysql_server_data_source.go index c385614c0a30..8668de2b4144 100644 --- a/internal/services/mysql/mysql_server_data_source.go +++ b/internal/services/mysql/mysql_server_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2020-01-01/mysql" + "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2020-01-01/mysql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/mysql/mysql_server_key_resource.go b/internal/services/mysql/mysql_server_key_resource.go index 79068daeaa97..c5a9610a52ce 100644 --- a/internal/services/mysql/mysql_server_key_resource.go +++ b/internal/services/mysql/mysql_server_key_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2020-01-01/mysql" + "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2020-01-01/mysql" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" diff --git a/internal/services/mysql/mysql_server_resource.go b/internal/services/mysql/mysql_server_resource.go index 9943c27eff54..6ca2cab67b95 100644 --- a/internal/services/mysql/mysql_server_resource.go +++ b/internal/services/mysql/mysql_server_resource.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2020-01-01/mysql" + "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2020-01-01/mysql" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/internal/services/mysql/mysql_virtual_network_rule_resource.go b/internal/services/mysql/mysql_virtual_network_rule_resource.go index 002811174464..7ce763c2e884 100644 --- a/internal/services/mysql/mysql_virtual_network_rule_resource.go +++ b/internal/services/mysql/mysql_virtual_network_rule_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2020-01-01/mysql" + "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2020-01-01/mysql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/network/application_gateway_resource.go b/internal/services/network/application_gateway_resource.go index 7e0de85b83a1..da2bf58fe9a9 100644 --- a/internal/services/network/application_gateway_resource.go +++ b/internal/services/network/application_gateway_resource.go @@ -137,7 +137,7 @@ func resourceApplicationGateway() *pluginsdk.Resource { "identity": commonschema.UserAssignedIdentityOptional(), - //lintignore:S016,S023 + // lintignore:S016,S023 "backend_address_pool": { Type: pluginsdk.TypeSet, Required: true, @@ -175,7 +175,7 @@ func resourceApplicationGateway() *pluginsdk.Resource { Set: applicationGatewayBackendAddressPool, }, - //lintignore:S016,S017,S023 + // lintignore:S016,S017,S023 "backend_http_settings": { Type: pluginsdk.TypeSet, Required: true, @@ -428,7 +428,7 @@ func resourceApplicationGateway() *pluginsdk.Resource { }, }, - //lintignore:S016,S023 + // lintignore:S016,S023 "http_listener": { Type: pluginsdk.TypeSet, Required: true, @@ -899,7 +899,7 @@ func resourceApplicationGateway() *pluginsdk.Resource { }, }, - //lintignore:XS003 + // lintignore:XS003 "ssl_policy": sslProfileSchema(true), // TODO 4.0: change this from enable_* to *_enabled @@ -913,7 +913,7 @@ func resourceApplicationGateway() *pluginsdk.Resource { Optional: true, }, - //lintignore:S016,S023 + // lintignore:S016,S023 "probe": { Type: pluginsdk.TypeSet, Optional: true, @@ -976,7 +976,7 @@ func resourceApplicationGateway() *pluginsdk.Resource { Default: 0, }, - //lintignore:XS003 + // lintignore:XS003 "match": { Type: pluginsdk.TypeList, Optional: true, @@ -1142,7 +1142,7 @@ func resourceApplicationGateway() *pluginsdk.Resource { }, }, - //lintignore:S016,S023 + // lintignore:S016,S023 "ssl_certificate": { Type: pluginsdk.TypeSet, Optional: true, @@ -1236,7 +1236,7 @@ func resourceApplicationGateway() *pluginsdk.Resource { Default: false, }, - //lintignore:XS003 + // lintignore:XS003 "ssl_policy": sslProfileSchema(false), "id": { @@ -1597,10 +1597,7 @@ func resourceApplicationGatewayCreate(d *pluginsdk.ResourceData, meta interface{ gatewayIPConfigurations, stopApplicationGateway := expandApplicationGatewayIPConfigurations(d) - globalConfiguration, err := expandApplicationGatewayGlobalConfiguration(d.Get("global").([]interface{})) - if err != nil { - return fmt.Errorf("expanding `global`: %+v", err) - } + globalConfiguration := expandApplicationGatewayGlobalConfiguration(d.Get("global").([]interface{})) httpListeners, err := expandApplicationGatewayHTTPListeners(d, id.ID()) if err != nil { @@ -1836,11 +1833,7 @@ func resourceApplicationGatewayUpdate(d *pluginsdk.ResourceData, meta interface{ } if d.HasChange("global") { - globalConfiguration, err := expandApplicationGatewayGlobalConfiguration(d.Get("global").([]interface{})) - if err != nil { - return fmt.Errorf("expanding `global`: %+v", err) - } - + globalConfiguration := expandApplicationGatewayGlobalConfiguration(d.Get("global").([]interface{})) applicationGateway.ApplicationGatewayPropertiesFormat.GlobalConfiguration = globalConfiguration } @@ -3021,16 +3014,16 @@ func flattenApplicationGatewayIPConfigurations(input *[]network.ApplicationGatew return results } -func expandApplicationGatewayGlobalConfiguration(input []interface{}) (*network.ApplicationGatewayGlobalConfiguration, error) { +func expandApplicationGatewayGlobalConfiguration(input []interface{}) *network.ApplicationGatewayGlobalConfiguration { if len(input) == 0 { - return nil, nil + return nil } v := input[0].(map[string]interface{}) return &network.ApplicationGatewayGlobalConfiguration{ EnableRequestBuffering: utils.Bool(v["request_buffering_enabled"].(bool)), EnableResponseBuffering: utils.Bool(v["response_buffering_enabled"].(bool)), - }, nil + } } func flattenApplicationGatewayGlobalConfiguration(input *network.ApplicationGatewayGlobalConfiguration) []interface{} { diff --git a/internal/services/network/express_route_port_resource_test.go b/internal/services/network/express_route_port_resource_test.go index 31ea0282b101..30a8cf753af6 100644 --- a/internal/services/network/express_route_port_resource_test.go +++ b/internal/services/network/express_route_port_resource_test.go @@ -50,7 +50,7 @@ func TestAccAzureRMExpressRoutePort_basic(t *testing.T) { func TestAccAzureRMExpressRoutePort_adminState(t *testing.T) { if _, ok := os.LookupEnv(ARMTestExpressRoutePortAdminState); !ok { - t.Skip(fmt.Sprintf("Enabling admin state will cause high cost, please set environment variable %q if you want to test it.", ARMTestExpressRoutePortAdminState)) + t.Skipf("Enabling admin state will cause high cost, please set environment variable %q if you want to test it.", ARMTestExpressRoutePortAdminState) } data := acceptance.BuildTestData(t, "azurerm_express_route_port", "test") r := ExpressRoutePortResource{} diff --git a/internal/services/network/network_connection_monitor_resource.go b/internal/services/network/network_connection_monitor_resource.go index 1ccb3652903d..866b7a7715fd 100644 --- a/internal/services/network/network_connection_monitor_resource.go +++ b/internal/services/network/network_connection_monitor_resource.go @@ -301,7 +301,7 @@ func resourceNetworkConnectionMonitorSchema() map[string]*pluginsdk.Schema { }, false), }, - //lintignore:XS003 + // lintignore:XS003 "success_threshold": { Type: pluginsdk.TypeList, Optional: true, @@ -469,11 +469,7 @@ func resourceNetworkConnectionMonitorCreateUpdate(d *pluginsdk.ResourceData, met }, } - if v, err := expandNetworkConnectionMonitorEndpoint(d.Get("endpoint").(*pluginsdk.Set).List()); err == nil { - properties.ConnectionMonitorParameters.Endpoints = v - } else { - return err - } + properties.ConnectionMonitorParameters.Endpoints = expandNetworkConnectionMonitorEndpoint(d.Get("endpoint").(*pluginsdk.Set).List()) if notes, ok := d.GetOk("notes"); ok { properties.Notes = utils.String(notes.(string)) @@ -572,7 +568,7 @@ func resourceNetworkConnectionMonitorDelete(d *pluginsdk.ResourceData, meta inte return nil } -func expandNetworkConnectionMonitorEndpoint(input []interface{}) (*[]network.ConnectionMonitorEndpoint, error) { +func expandNetworkConnectionMonitorEndpoint(input []interface{}) *[]network.ConnectionMonitorEndpoint { results := make([]network.ConnectionMonitorEndpoint, 0) for _, item := range input { @@ -628,7 +624,7 @@ func expandNetworkConnectionMonitorEndpoint(input []interface{}) (*[]network.Con results = append(results, result) } - return &results, nil + return &results } func expandNetworkConnectionMonitorEndpointFilter(input []interface{}) *network.ConnectionMonitorEndpointFilter { diff --git a/internal/services/policy/assignment.go b/internal/services/policy/assignment.go index 0648938045ee..663eb2e9d05c 100644 --- a/internal/services/policy/assignment.go +++ b/internal/services/policy/assignment.go @@ -6,7 +6,7 @@ import ( "strconv" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/services/policy/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/policy/assignment_base_resource.go b/internal/services/policy/assignment_base_resource.go index e6e742e158ad..01b78168e913 100644 --- a/internal/services/policy/assignment_base_resource.go +++ b/internal/services/policy/assignment_base_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" @@ -155,7 +155,7 @@ func (br assignmentBaseResource) readFunc(scopeFieldName string) sdk.ResourceFun metadata.ResourceData.Set("name", id.Name) metadata.ResourceData.Set("location", location.NormalizeNilable(resp.Location)) - //lintignore:R001 + // lintignore:R001 metadata.ResourceData.Set(scopeFieldName, id.Scope) identity, _ := br.flattenIdentity(resp.Identity) diff --git a/internal/services/policy/assignment_data_source.go b/internal/services/policy/assignment_data_source.go index 31e87a7dd340..46cfa7ae4401 100644 --- a/internal/services/policy/assignment_data_source.go +++ b/internal/services/policy/assignment_data_source.go @@ -7,7 +7,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/internal/services/policy/client/client.go b/internal/services/policy/client/client.go index 2d57570ae7f3..ee833cf4d09a 100644 --- a/internal/services/policy/client/client.go +++ b/internal/services/policy/client/client.go @@ -1,9 +1,9 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/guestconfiguration/mgmt/2020-06-25/guestconfiguration" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" - policyPreview "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/guestconfiguration/mgmt/2020-06-25/guestconfiguration" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck + policyPreview "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/policy/exemption_management_group.go b/internal/services/policy/exemption_management_group.go index bbe7ef0d8710..0c231ed96c4a 100644 --- a/internal/services/policy/exemption_management_group.go +++ b/internal/services/policy/exemption_management_group.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/structure" diff --git a/internal/services/policy/exemption_resource.go b/internal/services/policy/exemption_resource.go index 56c4fabbd6f5..7cd8b37573d6 100644 --- a/internal/services/policy/exemption_resource.go +++ b/internal/services/policy/exemption_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/structure" diff --git a/internal/services/policy/exemption_resource_group.go b/internal/services/policy/exemption_resource_group.go index 3408d76729db..98857bcb8518 100644 --- a/internal/services/policy/exemption_resource_group.go +++ b/internal/services/policy/exemption_resource_group.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/structure" diff --git a/internal/services/policy/exemption_subscription.go b/internal/services/policy/exemption_subscription.go index ff3f22616e8a..a121caf43095 100644 --- a/internal/services/policy/exemption_subscription.go +++ b/internal/services/policy/exemption_subscription.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/internal/services/policy/policy.go b/internal/services/policy/policy.go index de51556ac519..7fefa678e6f7 100644 --- a/internal/services/policy/policy.go +++ b/internal/services/policy/policy.go @@ -6,7 +6,7 @@ import ( "encoding/json" "fmt" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/policy/policy_definition_data_source.go b/internal/services/policy/policy_definition_data_source.go index 1fa9df6b6b0b..4cb9df72cbf5 100644 --- a/internal/services/policy/policy_definition_data_source.go +++ b/internal/services/policy/policy_definition_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/policy/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/policy/policy_definition_resource.go b/internal/services/policy/policy_definition_resource.go index e5568a1b9983..fdd3e4c105d5 100644 --- a/internal/services/policy/policy_definition_resource.go +++ b/internal/services/policy/policy_definition_resource.go @@ -7,7 +7,7 @@ import ( "strconv" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/Azure/go-autorest/autorest" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/policy/policy_definition_resource_test.go b/internal/services/policy/policy_definition_resource_test.go index e9ac643a01ab..c40204f1e14d 100644 --- a/internal/services/policy/policy_definition_resource_test.go +++ b/internal/services/policy/policy_definition_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/policy/policy_set_definition_data_source.go b/internal/services/policy/policy_set_definition_data_source.go index 1f25723873d7..2ce680abe456 100644 --- a/internal/services/policy/policy_set_definition_data_source.go +++ b/internal/services/policy/policy_set_definition_data_source.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/policy/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/policy/policy_set_definition_resource.go b/internal/services/policy/policy_set_definition_resource.go index fc35120b231f..55f7cdaa64c7 100644 --- a/internal/services/policy/policy_set_definition_resource.go +++ b/internal/services/policy/policy_set_definition_resource.go @@ -10,7 +10,7 @@ import ( "strconv" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/Azure/go-autorest/autorest" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -99,7 +99,7 @@ func resourcePolicySetDefinitionSchema() map[string]*pluginsdk.Schema { DiffSuppressFunc: pluginsdk.SuppressJsonDiff, }, - //lintignore: S013 + // lintignore: S013 "policy_definition_reference": { Type: pluginsdk.TypeList, Required: true, diff --git a/internal/services/policy/policy_set_definition_resource_test.go b/internal/services/policy/policy_set_definition_resource_test.go index 8eef42d42554..b21f274068ad 100644 --- a/internal/services/policy/policy_set_definition_resource_test.go +++ b/internal/services/policy/policy_set_definition_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/policy/policy_virtual_machine_configuration_assignment_data_source.go b/internal/services/policy/policy_virtual_machine_configuration_assignment_data_source.go index be259c34b355..5896e8b3271c 100644 --- a/internal/services/policy/policy_virtual_machine_configuration_assignment_data_source.go +++ b/internal/services/policy/policy_virtual_machine_configuration_assignment_data_source.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/guestconfiguration/mgmt/2020-06-25/guestconfiguration" + "github.com/Azure/azure-sdk-for-go/services/guestconfiguration/mgmt/2020-06-25/guestconfiguration" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/policy/parse" diff --git a/internal/services/policy/policy_virtual_machine_configuration_assignment_resource.go b/internal/services/policy/policy_virtual_machine_configuration_assignment_resource.go index 014a8fcf61fb..e871ce42eacb 100644 --- a/internal/services/policy/policy_virtual_machine_configuration_assignment_resource.go +++ b/internal/services/policy/policy_virtual_machine_configuration_assignment_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/guestconfiguration/mgmt/2020-06-25/guestconfiguration" + "github.com/Azure/azure-sdk-for-go/services/guestconfiguration/mgmt/2020-06-25/guestconfiguration" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/policy/remediation_management_group.go b/internal/services/policy/remediation_management_group.go index 712934193d97..8477bcc43d87 100644 --- a/internal/services/policy/remediation_management_group.go +++ b/internal/services/policy/remediation_management_group.go @@ -208,7 +208,7 @@ func resourceArmManagementGroupPolicyRemediationDelete(d *pluginsdk.ResourceData return fmt.Errorf("retrieving %s: %+v", id, err) } - if err := waitRemediationToDelete(ctx, existing.Model.Properties, id.ID(), d.Timeout(pluginsdk.TimeoutDelete), + if err := waitForRemediationToDelete(ctx, existing.Model.Properties, id.ID(), d.Timeout(pluginsdk.TimeoutDelete), func() error { _, err := client.RemediationsCancelAtManagementGroup(ctx, *id) return err diff --git a/internal/services/policy/remediation_resource.go b/internal/services/policy/remediation_resource.go index 23444ff16a27..617fb795a5e9 100644 --- a/internal/services/policy/remediation_resource.go +++ b/internal/services/policy/remediation_resource.go @@ -201,7 +201,7 @@ func resourceArmResourcePolicyRemediationDelete(d *pluginsdk.ResourceData, meta return fmt.Errorf("retrieving %s: %+v", id, err) } - if err := waitRemediationToDelete(ctx, + if err := waitForRemediationToDelete(ctx, existing.Model.Properties, id.ID(), d.Timeout(pluginsdk.TimeoutDelete), @@ -236,8 +236,8 @@ func resourcePolicyRemediationCancellationRefreshFunc(ctx context.Context, clien } } -// waitRemediationToDelete waits for the remediation to a status that allow to delete -func waitRemediationToDelete(ctx context.Context, +// waitForRemediationToDelete waits for the remediation to a status that allow to delete +func waitForRemediationToDelete(ctx context.Context, prop *remediations.RemediationProperties, id string, timeout time.Duration, diff --git a/internal/services/policy/remediation_resource_group.go b/internal/services/policy/remediation_resource_group.go index 17cd1dd3b3f6..5272b75e2550 100644 --- a/internal/services/policy/remediation_resource_group.go +++ b/internal/services/policy/remediation_resource_group.go @@ -207,14 +207,14 @@ func resourceArmResourceGroupPolicyRemediationDelete(d *pluginsdk.ResourceData, return fmt.Errorf("retrieving %s: %+v", id, err) } - if err := waitRemediationToDelete(ctx, existing.Model.Properties, id.ID(), d.Timeout(pluginsdk.TimeoutDelete), + if err := waitForRemediationToDelete(ctx, existing.Model.Properties, id.ID(), d.Timeout(pluginsdk.TimeoutDelete), func() error { _, err := client.RemediationsCancelAtResourceGroup(ctx, *id) return err }, resourceGroupPolicyRemediationCancellationRefreshFunc(ctx, client, *id), ); err != nil { - + return fmt.Errorf("waiting for remediation to delete %s: %+v", id, err) } _, err = client.RemediationsDeleteAtResourceGroup(ctx, *id) diff --git a/internal/services/policy/remediation_subscription.go b/internal/services/policy/remediation_subscription.go index 8c76fa7102e4..a78f5c7ca728 100644 --- a/internal/services/policy/remediation_subscription.go +++ b/internal/services/policy/remediation_subscription.go @@ -206,7 +206,7 @@ func resourceArmSubscriptionPolicyRemediationDelete(d *pluginsdk.ResourceData, m return fmt.Errorf("retrieving %s: %+v", id, err) } - if err := waitRemediationToDelete(ctx, existing.Model.Properties, id.ID(), d.Timeout(pluginsdk.TimeoutDelete), + if err := waitForRemediationToDelete(ctx, existing.Model.Properties, id.ID(), d.Timeout(pluginsdk.TimeoutDelete), func() error { _, err := client.RemediationsCancelAtSubscription(ctx, *id) return err diff --git a/internal/services/privatedns/private_dns_zone_data_source.go b/internal/services/privatedns/private_dns_zone_data_source.go index 6e112d3b3ef9..a5b6e7bcf457 100644 --- a/internal/services/privatedns/private_dns_zone_data_source.go +++ b/internal/services/privatedns/private_dns_zone_data_source.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" diff --git a/internal/services/privatednsresolver/private_dns_resolver_dns_forwarding_ruleset_resource.go b/internal/services/privatednsresolver/private_dns_resolver_dns_forwarding_ruleset_resource.go index 938e7db70f94..6a04612c5603 100644 --- a/internal/services/privatednsresolver/private_dns_resolver_dns_forwarding_ruleset_resource.go +++ b/internal/services/privatednsresolver/private_dns_resolver_dns_forwarding_ruleset_resource.go @@ -96,10 +96,7 @@ func (r PrivateDNSResolverDnsForwardingRulesetResource) Create() sdk.ResourceFun Tags: &model.Tags, } - dnsResolverOutboundEndpointsValue, err := expandDnsResolverOutboundEndpoints(model.DnsResolverOutboundEndpoints) - if err != nil { - return err - } + dnsResolverOutboundEndpointsValue := expandDnsResolverOutboundEndpoints(model.DnsResolverOutboundEndpoints) if dnsResolverOutboundEndpointsValue != nil { properties.Properties.DnsResolverOutboundEndpoints = *dnsResolverOutboundEndpointsValue @@ -142,10 +139,7 @@ func (r PrivateDNSResolverDnsForwardingRulesetResource) Update() sdk.ResourceFun } if metadata.ResourceData.HasChange("dns_resolver_outbound_endpoints") { - dnsResolverOutboundEndpointsValue, err := expandDnsResolverOutboundEndpoints(model.DnsResolverOutboundEndpoints) - if err != nil { - return err - } + dnsResolverOutboundEndpointsValue := expandDnsResolverOutboundEndpoints(model.DnsResolverOutboundEndpoints) if dnsResolverOutboundEndpointsValue != nil { properties.Properties.DnsResolverOutboundEndpoints = *dnsResolverOutboundEndpointsValue @@ -199,12 +193,8 @@ func (r PrivateDNSResolverDnsForwardingRulesetResource) Read() sdk.ResourceFunc } properties := &model.Properties - dnsResolverOutboundEndpointsValue, err := flattenDnsResolverOutboundEndpoints(&properties.DnsResolverOutboundEndpoints) - if err != nil { - return err - } - state.DnsResolverOutboundEndpoints = dnsResolverOutboundEndpointsValue + state.DnsResolverOutboundEndpoints = flattenDnsResolverOutboundEndpoints(&properties.DnsResolverOutboundEndpoints) if model.Tags != nil { state.Tags = *model.Tags @@ -235,7 +225,7 @@ func (r PrivateDNSResolverDnsForwardingRulesetResource) Delete() sdk.ResourceFun } } -func expandDnsResolverOutboundEndpoints(inputList []string) (*[]dnsforwardingrulesets.SubResource, error) { +func expandDnsResolverOutboundEndpoints(inputList []string) *[]dnsforwardingrulesets.SubResource { var outputList []dnsforwardingrulesets.SubResource for _, v := range inputList { output := dnsforwardingrulesets.SubResource{ @@ -244,13 +234,13 @@ func expandDnsResolverOutboundEndpoints(inputList []string) (*[]dnsforwardingrul outputList = append(outputList, output) } - return &outputList, nil + return &outputList } -func flattenDnsResolverOutboundEndpoints(inputList *[]dnsforwardingrulesets.SubResource) ([]string, error) { +func flattenDnsResolverOutboundEndpoints(inputList *[]dnsforwardingrulesets.SubResource) []string { var outputList []string if inputList == nil { - return outputList, nil + return outputList } for _, input := range *inputList { @@ -258,5 +248,5 @@ func flattenDnsResolverOutboundEndpoints(inputList *[]dnsforwardingrulesets.SubR outputList = append(outputList, output) } - return outputList, nil + return outputList } diff --git a/internal/services/privatednsresolver/private_dns_resolver_forwarding_rule_resource.go b/internal/services/privatednsresolver/private_dns_resolver_forwarding_rule_resource.go index b14f86fcd136..49451c049ef6 100644 --- a/internal/services/privatednsresolver/private_dns_resolver_forwarding_rule_resource.go +++ b/internal/services/privatednsresolver/private_dns_resolver_forwarding_rule_resource.go @@ -141,11 +141,7 @@ func (r PrivateDNSResolverForwardingRuleResource) Create() sdk.ResourceFunc { }, } - targetDnsServersValue, err := expandTargetDnsServerModel(model.TargetDnsServers) - if err != nil { - return err - } - + targetDnsServersValue := expandTargetDnsServerModel(model.TargetDnsServers) if targetDnsServersValue != nil { properties.Properties.TargetDnsServers = *targetDnsServersValue } @@ -203,10 +199,7 @@ func (r PrivateDNSResolverForwardingRuleResource) Update() sdk.ResourceFunc { } if metadata.ResourceData.HasChange("target_dns_servers") { - targetDnsServersValue, err := expandTargetDnsServerModel(model.TargetDnsServers) - if err != nil { - return err - } + targetDnsServersValue := expandTargetDnsServerModel(model.TargetDnsServers) if targetDnsServersValue != nil { properties.Properties.TargetDnsServers = *targetDnsServersValue @@ -266,12 +259,7 @@ func (r PrivateDNSResolverForwardingRuleResource) Read() sdk.ResourceFunc { state.Metadata = *properties.Metadata } - targetDnsServersValue, err := flattenTargetDnsServerModel(&properties.TargetDnsServers) - if err != nil { - return err - } - - state.TargetDnsServers = targetDnsServersValue + state.TargetDnsServers = flattenTargetDnsServerModel(&properties.TargetDnsServers) return metadata.Encode(&state) }, @@ -298,7 +286,7 @@ func (r PrivateDNSResolverForwardingRuleResource) Delete() sdk.ResourceFunc { } } -func expandTargetDnsServerModel(inputList []TargetDnsServerModel) (*[]forwardingrules.TargetDnsServer, error) { +func expandTargetDnsServerModel(inputList []TargetDnsServerModel) *[]forwardingrules.TargetDnsServer { var outputList []forwardingrules.TargetDnsServer for _, v := range inputList { input := v @@ -310,13 +298,13 @@ func expandTargetDnsServerModel(inputList []TargetDnsServerModel) (*[]forwarding outputList = append(outputList, output) } - return &outputList, nil + return &outputList } -func flattenTargetDnsServerModel(inputList *[]forwardingrules.TargetDnsServer) ([]TargetDnsServerModel, error) { +func flattenTargetDnsServerModel(inputList *[]forwardingrules.TargetDnsServer) []TargetDnsServerModel { var outputList []TargetDnsServerModel if inputList == nil { - return outputList, nil + return outputList } for _, input := range *inputList { @@ -331,5 +319,5 @@ func flattenTargetDnsServerModel(inputList *[]forwardingrules.TargetDnsServer) ( outputList = append(outputList, output) } - return outputList, nil + return outputList } diff --git a/internal/services/privatednsresolver/private_dns_resolver_inbound_endpoint_resource.go b/internal/services/privatednsresolver/private_dns_resolver_inbound_endpoint_resource.go index 88112a74cd32..bc9b0bf77505 100644 --- a/internal/services/privatednsresolver/private_dns_resolver_inbound_endpoint_resource.go +++ b/internal/services/privatednsresolver/private_dns_resolver_inbound_endpoint_resource.go @@ -133,10 +133,7 @@ func (r PrivateDNSResolverInboundEndpointResource) Create() sdk.ResourceFunc { Tags: &model.Tags, } - iPConfigurationsValue, err := expandIPConfigurationModel(model.IPConfigurations) - if err != nil { - return err - } + iPConfigurationsValue := expandIPConfigurationModel(model.IPConfigurations) if iPConfigurationsValue != nil { properties.Properties.IPConfigurations = *iPConfigurationsValue @@ -179,10 +176,7 @@ func (r PrivateDNSResolverInboundEndpointResource) Update() sdk.ResourceFunc { } if metadata.ResourceData.HasChange("ip_configurations") { - iPConfigurationsValue, err := expandIPConfigurationModel(model.IPConfigurations) - if err != nil { - return err - } + iPConfigurationsValue := expandIPConfigurationModel(model.IPConfigurations) if iPConfigurationsValue != nil { properties.Properties.IPConfigurations = *iPConfigurationsValue @@ -236,12 +230,8 @@ func (r PrivateDNSResolverInboundEndpointResource) Read() sdk.ResourceFunc { } properties := &model.Properties - iPConfigurationsValue, err := flattenIPConfigurationModel(&properties.IPConfigurations) - if err != nil { - return err - } - state.IPConfigurations = iPConfigurationsValue + state.IPConfigurations = flattenIPConfigurationModel(&properties.IPConfigurations) if model.Tags != nil { state.Tags = *model.Tags } @@ -301,7 +291,7 @@ func dnsResolverInboundEndpointDeleteRefreshFunc(ctx context.Context, client *in } } -func expandIPConfigurationModel(inputList []IPConfigurationModel) (*[]inboundendpoints.IPConfiguration, error) { +func expandIPConfigurationModel(inputList []IPConfigurationModel) *[]inboundendpoints.IPConfiguration { var outputList []inboundendpoints.IPConfiguration for _, v := range inputList { input := v @@ -322,13 +312,13 @@ func expandIPConfigurationModel(inputList []IPConfigurationModel) (*[]inboundend outputList = append(outputList, output) } - return &outputList, nil + return &outputList } -func flattenIPConfigurationModel(inputList *[]inboundendpoints.IPConfiguration) ([]IPConfigurationModel, error) { +func flattenIPConfigurationModel(inputList *[]inboundendpoints.IPConfiguration) []IPConfigurationModel { var outputList []IPConfigurationModel if inputList == nil { - return outputList, nil + return outputList } for _, input := range *inputList { @@ -347,5 +337,5 @@ func flattenIPConfigurationModel(inputList *[]inboundendpoints.IPConfiguration) outputList = append(outputList, output) } - return outputList, nil + return outputList } diff --git a/internal/services/recoveryservices/backup_container_storage_account_resource.go b/internal/services/recoveryservices/backup_container_storage_account_resource.go index 4c8760c8c443..d8231357f3cc 100644 --- a/internal/services/recoveryservices/backup_container_storage_account_resource.go +++ b/internal/services/recoveryservices/backup_container_storage_account_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/recoveryservices/backup_policy_file_share_resource.go b/internal/services/recoveryservices/backup_policy_file_share_resource.go index 0a43ccf5a6ee..45d41c7b9dbd 100644 --- a/internal/services/recoveryservices/backup_policy_file_share_resource.go +++ b/internal/services/recoveryservices/backup_policy_file_share_resource.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/recoveryservices/backup_policy_vm_resource.go b/internal/services/recoveryservices/backup_policy_vm_resource.go index b94552977544..0c4c370d13cf 100644 --- a/internal/services/recoveryservices/backup_policy_vm_resource.go +++ b/internal/services/recoveryservices/backup_policy_vm_resource.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/recoveryservices/backup_policy_vm_resource_test.go b/internal/services/recoveryservices/backup_policy_vm_resource_test.go index b8f13e6a10ad..56b7cde1f332 100644 --- a/internal/services/recoveryservices/backup_policy_vm_resource_test.go +++ b/internal/services/recoveryservices/backup_policy_vm_resource_test.go @@ -587,6 +587,7 @@ resource "azurerm_backup_policy_vm" "test" { `, r.template(data), data.RandomInteger) } +// nolint: unparam func (r BackupProtectionPolicyVMResource) basicHourly(data acceptance.TestData, policyType string) string { return fmt.Sprintf(` %s diff --git a/internal/services/recoveryservices/backup_policy_vm_workload_resource.go b/internal/services/recoveryservices/backup_policy_vm_workload_resource.go index abd9f4cca0f9..231dad90836f 100644 --- a/internal/services/recoveryservices/backup_policy_vm_workload_resource.go +++ b/internal/services/recoveryservices/backup_policy_vm_workload_resource.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -632,19 +632,19 @@ func expandBackupProtectionPolicyVMWorkloadProtectionPolicies(input []Protection return nil, fmt.Errorf("`retention_daily` must be set when `backup.0.frequency` is `Daily`") } - if weekdays := backupBlock.Weekdays; weekdays != nil && len(weekdays) > 0 { + if weekdays := backupBlock.Weekdays; len(weekdays) > 0 { return nil, fmt.Errorf("`backup.0.weekdays` should be not set when `backup.0.frequency` is `Daily`") } case string(backup.ScheduleRunTypeWeekly): - if item.RetentionDaily != nil && len(item.RetentionDaily) > 0 { + if len(item.RetentionDaily) > 0 { return nil, fmt.Errorf("`retention_daily` must be not set when `backup.0.frequency` is `Weekly`") } - if item.PolicyType != string(backup.PolicyTypeLog) && (backupBlock.Weekdays == nil || len(backupBlock.Weekdays) == 0) { + if item.PolicyType != string(backup.PolicyTypeLog) && len(backupBlock.Weekdays) == 0 { return nil, fmt.Errorf("`backup.weekdays` must be set when `policy_type` is not `Log` and `backup.frequency` is `Weekly`") } - if item.PolicyType == string(backup.PolicyTypeFull) && (item.RetentionWeekly == nil || len(item.RetentionWeekly) == 0) { + if item.PolicyType == string(backup.PolicyTypeFull) && len(item.RetentionWeekly) == 0 { return nil, fmt.Errorf("`retention_weekly` must be set when `policy_type` is `Full` and `backup.frequency` is `Weekly`") } } @@ -723,11 +723,11 @@ func expandBackupProtectionPolicyVMWorkloadSchedulePolicy(input ProtectionPolicy schedule.ScheduleRunFrequency = backup.ScheduleRunType(backupBlock.Frequency) } - if times != nil && len(times) > 0 { + if len(times) > 0 { schedule.ScheduleRunTimes = × } - if v := backupBlock.Weekdays; v != nil && len(v) > 0 { + if v := backupBlock.Weekdays; len(v) > 0 { days := make([]backup.DayOfWeek, 0) for _, day := range v { days = append(days, backup.DayOfWeek(day)) @@ -803,7 +803,7 @@ func expandBackupProtectionPolicyVMWorkloadRetentionPolicy(input ProtectionPolic }, } - if v := retentionWeekly.Weekdays; v != nil && len(v) > 0 { + if v := retentionWeekly.Weekdays; len(v) > 0 { days := make([]backup.DayOfWeek, 0) for _, day := range v { days = append(days, backup.DayOfWeek(day)) @@ -1012,7 +1012,7 @@ func flattenBackupProtectionPolicyVMWorkloadSimpleRetention(input *backup.Retent } func expandBackupProtectionPolicyVMWorkloadRetentionDailyFormat(input []int) *backup.DailyRetentionFormat { - if input == nil || len(input) == 0 { + if len(input) == 0 { return nil } @@ -1038,13 +1038,13 @@ func expandBackupProtectionPolicyVMWorkloadRetentionDailyFormat(input []int) *ba } func expandBackupProtectionPolicyVMWorkloadRetentionWeeklyFormat(weekdays, weeks []string) *backup.WeeklyRetentionFormat { - if (weekdays == nil && weeks == nil) || (len(weekdays) == 0 && len(weeks) == 0) { + if len(weekdays) == 0 && len(weeks) == 0 { return nil } weekly := backup.WeeklyRetentionFormat{} - if weekdays != nil && len(weekdays) > 0 { + if len(weekdays) > 0 { weekdaysBlock := make([]backup.DayOfWeek, 0) for _, day := range weekdays { weekdaysBlock = append(weekdaysBlock, backup.DayOfWeek(day)) @@ -1052,7 +1052,7 @@ func expandBackupProtectionPolicyVMWorkloadRetentionWeeklyFormat(weekdays, weeks weekly.DaysOfTheWeek = &weekdaysBlock } - if weeks != nil && len(weeks) > 0 { + if len(weeks) > 0 { weeksBlock := make([]backup.WeekOfMonth, 0) for _, week := range weeks { weeksBlock = append(weeksBlock, backup.WeekOfMonth(week)) diff --git a/internal/services/recoveryservices/backup_protected_file_share_resource.go b/internal/services/recoveryservices/backup_protected_file_share_resource.go index b0454def6ca9..ca55510c3928 100644 --- a/internal/services/recoveryservices/backup_protected_file_share_resource.go +++ b/internal/services/recoveryservices/backup_protected_file_share_resource.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/recoveryservices/backup_protected_vm_resource.go b/internal/services/recoveryservices/backup_protected_vm_resource.go index 94a869c680aa..72554fc599f9 100644 --- a/internal/services/recoveryservices/backup_protected_vm_resource.go +++ b/internal/services/recoveryservices/backup_protected_vm_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -109,7 +109,7 @@ func resourceRecoveryServicesBackupProtectedVMCreateUpdate(d *pluginsdk.Resource return fmt.Errorf("creating/updating Azure Backup Protected VM %q (Resource Group %q): %+v", protectedItemName, resourceGroup, err) } - resp, err := resourceRecoveryServicesBackupProtectedVMWaitForStateCreateUpdate(ctx, client, vaultName, resourceGroup, containerName, protectedItemName, policyId, d) + resp, err := resourceRecoveryServicesBackupProtectedVMWaitForStateCreateUpdate(ctx, client, vaultName, resourceGroup, containerName, protectedItemName, d) if err != nil { return err } @@ -196,13 +196,13 @@ func resourceRecoveryServicesBackupProtectedVMDelete(d *pluginsdk.ResourceData, return nil } -func resourceRecoveryServicesBackupProtectedVMWaitForStateCreateUpdate(ctx context.Context, client *backup.ProtectedItemsClient, vaultName, resourceGroup, containerName, protectedItemName string, policyId string, d *pluginsdk.ResourceData) (backup.ProtectedItemResource, error) { +func resourceRecoveryServicesBackupProtectedVMWaitForStateCreateUpdate(ctx context.Context, client *backup.ProtectedItemsClient, vaultName, resourceGroup, containerName, protectedItemName string, d *pluginsdk.ResourceData) (backup.ProtectedItemResource, error) { state := &pluginsdk.StateChangeConf{ MinTimeout: 30 * time.Second, Delay: 10 * time.Second, Pending: []string{"NotFound"}, Target: []string{"Found"}, - Refresh: resourceRecoveryServicesBackupProtectedVMRefreshFunc(ctx, client, vaultName, resourceGroup, containerName, protectedItemName, policyId, true), + Refresh: resourceRecoveryServicesBackupProtectedVMRefreshFunc(ctx, client, vaultName, resourceGroup, containerName, protectedItemName), } if d.IsNewResource() { @@ -258,7 +258,7 @@ func resourceRecoveryServicesBackupProtectedVMWaitForDeletion(ctx context.Contex return resp.(backup.ProtectedItemResource), nil } -func resourceRecoveryServicesBackupProtectedVMRefreshFunc(ctx context.Context, client *backup.ProtectedItemsClient, vaultName, resourceGroup, containerName, protectedItemName string, policyId string, newResource bool) pluginsdk.StateRefreshFunc { +func resourceRecoveryServicesBackupProtectedVMRefreshFunc(ctx context.Context, client *backup.ProtectedItemsClient, vaultName, resourceGroup, containerName, protectedItemName string) pluginsdk.StateRefreshFunc { return func() (interface{}, string, error) { resp, err := client.Get(ctx, vaultName, resourceGroup, "Azure", containerName, protectedItemName, "") if err != nil { diff --git a/internal/services/recoveryservices/client/client.go b/internal/services/recoveryservices/client/client.go index b6bd1f97be98..0b98f4716a2c 100644 --- a/internal/services/recoveryservices/client/client.go +++ b/internal/services/recoveryservices/client/client.go @@ -1,9 +1,9 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-08-01/recoveryservices" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-08-01/recoveryservices" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/recoveryservices/recovery_services_vault_resource.go b/internal/services/recoveryservices/recovery_services_vault_resource.go index 4f5767d2fa47..6a932d350a41 100644 --- a/internal/services/recoveryservices/recovery_services_vault_resource.go +++ b/internal/services/recoveryservices/recovery_services_vault_resource.go @@ -6,8 +6,8 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-08-01/recoveryservices" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-08-01/recoveryservices" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-12-01/backup" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/recoveryservices/site_recovery_fabric_resource.go b/internal/services/recoveryservices/site_recovery_fabric_resource.go index d93b29af073f..150bd19890d0 100644 --- a/internal/services/recoveryservices/site_recovery_fabric_resource.go +++ b/internal/services/recoveryservices/site_recovery_fabric_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/recoveryservices/site_recovery_network_mapping_resource.go b/internal/services/recoveryservices/site_recovery_network_mapping_resource.go index 326973bd3d99..77c54b080064 100644 --- a/internal/services/recoveryservices/site_recovery_network_mapping_resource.go +++ b/internal/services/recoveryservices/site_recovery_network_mapping_resource.go @@ -5,7 +5,7 @@ import ( "net/http" "time" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/recoveryservices/site_recovery_protection_container_mapping_resource.go b/internal/services/recoveryservices/site_recovery_protection_container_mapping_resource.go index b87e5335fbb6..fcdf0c7ad97a 100644 --- a/internal/services/recoveryservices/site_recovery_protection_container_mapping_resource.go +++ b/internal/services/recoveryservices/site_recovery_protection_container_mapping_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/recoveryservices/site_recovery_protection_container_resource.go b/internal/services/recoveryservices/site_recovery_protection_container_resource.go index 0f165b80f035..18f511217e40 100644 --- a/internal/services/recoveryservices/site_recovery_protection_container_resource.go +++ b/internal/services/recoveryservices/site_recovery_protection_container_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/recoveryservices/site_recovery_replicated_vm_resource.go b/internal/services/recoveryservices/site_recovery_replicated_vm_resource.go index 45702ad17928..7c966686b9c4 100644 --- a/internal/services/recoveryservices/site_recovery_replicated_vm_resource.go +++ b/internal/services/recoveryservices/site_recovery_replicated_vm_resource.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/recoveryservices/site_recovery_replication_policy_resource.go b/internal/services/recoveryservices/site_recovery_replication_policy_resource.go index 2f427f7a9cc5..5e208dc70a97 100644 --- a/internal/services/recoveryservices/site_recovery_replication_policy_resource.go +++ b/internal/services/recoveryservices/site_recovery_replication_policy_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" + "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-07-10/siterecovery" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/redis/client/client.go b/internal/services/redis/client/client.go index 6b54aefaec61..c42dac3e290d 100644 --- a/internal/services/redis/client/client.go +++ b/internal/services/redis/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2021-06-01/redis" + "github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2021-06-01/redis" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/redis/redis_cache_resource.go b/internal/services/redis/redis_cache_resource.go index 353ea3ab7502..1f42d86bc906 100644 --- a/internal/services/redis/redis_cache_resource.go +++ b/internal/services/redis/redis_cache_resource.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2021-06-01/redis" + "github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2021-06-01/redis" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/internal/services/redis/redis_firewall_rule_resource.go b/internal/services/redis/redis_firewall_rule_resource.go index 0465f508ff10..fe989a7d7997 100644 --- a/internal/services/redis/redis_firewall_rule_resource.go +++ b/internal/services/redis/redis_firewall_rule_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2021-06-01/redis" + "github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2021-06-01/redis" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/redis/redis_linked_server_resource.go b/internal/services/redis/redis_linked_server_resource.go index aa96c6b2495d..04fec875173f 100644 --- a/internal/services/redis/redis_linked_server_resource.go +++ b/internal/services/redis/redis_linked_server_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2021-06-01/redis" + "github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2021-06-01/redis" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/redisenterprise/validate/redis_enterprise_cluster_sku_name.go b/internal/services/redisenterprise/validate/redis_enterprise_cluster_sku_name.go index eafa7610ed38..4bbfe8238852 100644 --- a/internal/services/redisenterprise/validate/redis_enterprise_cluster_sku_name.go +++ b/internal/services/redisenterprise/validate/redis_enterprise_cluster_sku_name.go @@ -5,7 +5,7 @@ import ( "strconv" "strings" - "github.com/Azure/azure-sdk-for-go/services/redisenterprise/mgmt/2021-03-01/redisenterprise" + "github.com/Azure/azure-sdk-for-go/services/redisenterprise/mgmt/2021-03-01/redisenterprise" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" ) diff --git a/internal/services/resource/client/client.go b/internal/services/resource/client/client.go index 7724c0e38eaf..029cb5a48a13 100644 --- a/internal/services/resource/client/client.go +++ b/internal/services/resource/client/client.go @@ -2,10 +2,10 @@ package client import ( providers "github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources" - "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2019-06-01-preview/templatespecs" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2015-12-01/features" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-09-01/locks" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2019-06-01-preview/templatespecs" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2015-12-01/features" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-09-01/locks" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/resource/management_group_template_deployment_resource.go b/internal/services/resource/management_group_template_deployment_resource.go index c454cb2e325e..d48851b240c3 100644 --- a/internal/services/resource/management_group_template_deployment_resource.go +++ b/internal/services/resource/management_group_template_deployment_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -42,7 +42,7 @@ func managementGroupTemplateDeploymentResource() *pluginsdk.Resource { // (@jackofallops - lintignore needed as we need to make sure the JSON is usable in `output_content`) - //lintignore:S033 + // lintignore:S033 Schema: map[string]*pluginsdk.Schema{ "name": { Type: pluginsdk.TypeString, diff --git a/internal/services/resource/management_lock_resource.go b/internal/services/resource/management_lock_resource.go index afe8b72286a8..7273fd7d37c6 100644 --- a/internal/services/resource/management_lock_resource.go +++ b/internal/services/resource/management_lock_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-09-01/locks" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-09-01/locks" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/resource/parse" diff --git a/internal/services/resource/resource_group_resource.go b/internal/services/resource/resource_group_resource.go index 4eba2f54ff89..a778cb212f33 100644 --- a/internal/services/resource/resource_group_resource.go +++ b/internal/services/resource/resource_group_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/resource/resource_group_template_deployment_resource.go b/internal/services/resource/resource_group_template_deployment_resource.go index 62329b28f524..8b9584eed38e 100644 --- a/internal/services/resource/resource_group_template_deployment_resource.go +++ b/internal/services/resource/resource_group_template_deployment_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -39,7 +39,7 @@ func resourceGroupTemplateDeploymentResource() *pluginsdk.Resource { // (@jackofallops - lintignore needed as we need to make sure the JSON is usable in `output_content`) - //lintignore:S033 + // lintignore:S033 Schema: map[string]*pluginsdk.Schema{ "name": { Type: pluginsdk.TypeString, diff --git a/internal/services/resource/resource_provider_registration_resource.go b/internal/services/resource/resource_provider_registration_resource.go index fd08d113d79b..bcc056982fc6 100644 --- a/internal/services/resource/resource_provider_registration_resource.go +++ b/internal/services/resource/resource_provider_registration_resource.go @@ -8,7 +8,7 @@ import ( "time" "github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2015-12-01/features" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2015-12-01/features" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/resourceproviders" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" diff --git a/internal/services/resource/resources_data_source.go b/internal/services/resource/resources_data_source.go index c9f58bb6939e..75d24b8a931b 100644 --- a/internal/services/resource/resources_data_source.go +++ b/internal/services/resource/resources_data_source.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/google/uuid" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/resource/subscription_template_deployment_resource.go b/internal/services/resource/subscription_template_deployment_resource.go index 3ea6e1605614..b07890f2e130 100644 --- a/internal/services/resource/subscription_template_deployment_resource.go +++ b/internal/services/resource/subscription_template_deployment_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -40,7 +40,7 @@ func subscriptionTemplateDeploymentResource() *pluginsdk.Resource { // (@jackofallops - lintignore needed as we need to make sure the JSON is usable in `output_content`) - //lintignore:S033 + // lintignore:S033 Schema: map[string]*pluginsdk.Schema{ "name": { Type: pluginsdk.TypeString, diff --git a/internal/services/resource/template_deployment_common.go b/internal/services/resource/template_deployment_common.go index 55cc7a6ade48..2b5ea1e82b39 100644 --- a/internal/services/resource/template_deployment_common.go +++ b/internal/services/resource/template_deployment_common.go @@ -11,7 +11,7 @@ import ( "time" providers "github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/services/resource/client" diff --git a/internal/services/resource/template_deployment_resource.go b/internal/services/resource/template_deployment_resource.go index 86667c46c981..967e8dad7686 100644 --- a/internal/services/resource/template_deployment_resource.go +++ b/internal/services/resource/template_deployment_resource.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/resource/tenant_template_deployment_resource.go b/internal/services/resource/tenant_template_deployment_resource.go index 2a5c4fe74904..28864bfec459 100644 --- a/internal/services/resource/tenant_template_deployment_resource.go +++ b/internal/services/resource/tenant_template_deployment_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -40,7 +40,7 @@ func tenantTemplateDeploymentResource() *pluginsdk.Resource { // (@jackofallops - lintignore needed as we need to make sure the JSON is usable in `output_content`) - //lintignore:S033 + // lintignore:S033 Schema: map[string]*pluginsdk.Schema{ "name": { Type: pluginsdk.TypeString, diff --git a/internal/services/securitycenter/advanced_threat_protection_resource.go b/internal/services/securitycenter/advanced_threat_protection_resource.go index 380bdceddaff..508f434520d4 100644 --- a/internal/services/securitycenter/advanced_threat_protection_resource.go +++ b/internal/services/securitycenter/advanced_threat_protection_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/securitycenter/advanced_threat_protection_resource_test.go b/internal/services/securitycenter/advanced_threat_protection_resource_test.go index 82232ac4dae9..5b08aa8b0756 100644 --- a/internal/services/securitycenter/advanced_threat_protection_resource_test.go +++ b/internal/services/securitycenter/advanced_threat_protection_resource_test.go @@ -40,16 +40,15 @@ func TestAccAdvancedThreatProtection_storageAccount(t *testing.T) { } func TestAccAdvancedThreatProtection_cosmosAccount(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_advanced_threat_protection", "test") - - // nolint unused - r := AdvancedThreatProtectionResource{} - // the API errors on deleting the cosmos DB account some of the time so lets skip this test for now // TODO: remove once this is fixed: https://github.com/Azure/azure-sdk-for-go/issues/6310 // run it multiple times in a row as it only fails 50% of the time t.Skip() + data := acceptance.BuildTestData(t, "azurerm_advanced_threat_protection", "test") + + r := AdvancedThreatProtectionResource{} + data.ResourceTest(t, r, []acceptance.TestStep{ { Config: r.cosmosAccount(data, true, true), diff --git a/internal/services/securitycenter/azuresdkhacks/security_center_contact.go b/internal/services/securitycenter/azuresdkhacks/security_center_contact.go index 4e28a2834ec1..79f575d3c7cf 100644 --- a/internal/services/securitycenter/azuresdkhacks/security_center_contact.go +++ b/internal/services/securitycenter/azuresdkhacks/security_center_contact.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/validation" diff --git a/internal/services/securitycenter/azuresdkhacks/security_center_setting.go b/internal/services/securitycenter/azuresdkhacks/security_center_setting.go index ec5bf848cd64..ac80f1f771ee 100644 --- a/internal/services/securitycenter/azuresdkhacks/security_center_setting.go +++ b/internal/services/securitycenter/azuresdkhacks/security_center_setting.go @@ -5,7 +5,7 @@ import ( "fmt" "net/http" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" ) diff --git a/internal/services/securitycenter/client/client.go b/internal/services/securitycenter/client/client.go index 40208c7c4a7a..59b9c87acf70 100644 --- a/internal/services/securitycenter/client/client.go +++ b/internal/services/securitycenter/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck pricings_v2022_03_01 "github.com/hashicorp/go-azure-sdk/resource-manager/security/2022-03-01/pricings" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/securitycenter/iot_security_device_group_resource.go b/internal/services/securitycenter/iot_security_device_group_resource.go index 11fbda4a2f96..e90cf8a476ed 100644 --- a/internal/services/securitycenter/iot_security_device_group_resource.go +++ b/internal/services/securitycenter/iot_security_device_group_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/securitycenter/iot_security_solution_resource.go b/internal/services/securitycenter/iot_security_solution_resource.go index a20a97b888c7..fceefa5d3ed7 100644 --- a/internal/services/securitycenter/iot_security_solution_resource.go +++ b/internal/services/securitycenter/iot_security_solution_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2020-08-01/workspaces" diff --git a/internal/services/securitycenter/security_center_assessment_policy_resource.go b/internal/services/securitycenter/security_center_assessment_policy_resource.go index 8cfd7303c825..16c76f1f41cc 100644 --- a/internal/services/securitycenter/security_center_assessment_policy_resource.go +++ b/internal/services/securitycenter/security_center_assessment_policy_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/google/uuid" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/securitycenter/security_center_assessment_resource.go b/internal/services/securitycenter/security_center_assessment_resource.go index 5124c3c45f40..659ce53cd778 100644 --- a/internal/services/securitycenter/security_center_assessment_resource.go +++ b/internal/services/securitycenter/security_center_assessment_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/securitycenter/security_center_auto_provisioning_resource.go b/internal/services/securitycenter/security_center_auto_provisioning_resource.go index 64e0d3db1c0b..27ad2c7517a8 100644 --- a/internal/services/securitycenter/security_center_auto_provisioning_resource.go +++ b/internal/services/securitycenter/security_center_auto_provisioning_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/securitycenter/migration" "github.com/hashicorp/terraform-provider-azurerm/internal/services/securitycenter/parse" diff --git a/internal/services/securitycenter/security_center_automation_resource.go b/internal/services/securitycenter/security_center_automation_resource.go index b089a2321711..5baa0e0dff68 100644 --- a/internal/services/securitycenter/security_center_automation_resource.go +++ b/internal/services/securitycenter/security_center_automation_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/securitycenter/security_center_contact_resource.go b/internal/services/securitycenter/security_center_contact_resource.go index 3fdcba24ed23..0c90b681668f 100644 --- a/internal/services/securitycenter/security_center_contact_resource.go +++ b/internal/services/securitycenter/security_center_contact_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/features" diff --git a/internal/services/securitycenter/security_center_server_vulnerability_assessment_resource.go b/internal/services/securitycenter/security_center_server_vulnerability_assessment_resource.go index e435b11ea828..f52d923f8149 100644 --- a/internal/services/securitycenter/security_center_server_vulnerability_assessment_resource.go +++ b/internal/services/securitycenter/security_center_server_vulnerability_assessment_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/securitycenter/security_center_server_vulnerability_assessment_virtual_machine_resource.go b/internal/services/securitycenter/security_center_server_vulnerability_assessment_virtual_machine_resource.go index e61b260c0d14..75c670c59e2d 100644 --- a/internal/services/securitycenter/security_center_server_vulnerability_assessment_virtual_machine_resource.go +++ b/internal/services/securitycenter/security_center_server_vulnerability_assessment_virtual_machine_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" computeParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/parse" diff --git a/internal/services/securitycenter/security_center_setting_resource.go b/internal/services/securitycenter/security_center_setting_resource.go index 9c449e565af3..6461ec28e053 100644 --- a/internal/services/securitycenter/security_center_setting_resource.go +++ b/internal/services/securitycenter/security_center_setting_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/securitycenter/azuresdkhacks" diff --git a/internal/services/securitycenter/security_center_setting_resource_test.go b/internal/services/securitycenter/security_center_setting_resource_test.go index 24ca4bfddc8d..5b1e9bef373d 100644 --- a/internal/services/securitycenter/security_center_setting_resource_test.go +++ b/internal/services/securitycenter/security_center_setting_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -31,7 +31,7 @@ func testAccSecurityCenterSetting_update(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_security_center_setting", "test") r := SecurityCenterSettingResource{} - //lintignore:AT001 + // lintignore:AT001 data.ResourceSequentialTest(t, r, []acceptance.TestStep{ { Config: r.cfg("MCAS", true), diff --git a/internal/services/securitycenter/security_center_subscription_pricing_resource.go b/internal/services/securitycenter/security_center_subscription_pricing_resource.go index 92ba0946b247..216bc130c09f 100644 --- a/internal/services/securitycenter/security_center_subscription_pricing_resource.go +++ b/internal/services/securitycenter/security_center_subscription_pricing_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" pricings_v2022_03_01 "github.com/hashicorp/go-azure-sdk/resource-manager/security/2022-03-01/pricings" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/securitycenter/security_center_subscription_pricing_resource_test.go b/internal/services/securitycenter/security_center_subscription_pricing_resource_test.go index 99bfa447c02a..cd4553697071 100644 --- a/internal/services/securitycenter/security_center_subscription_pricing_resource_test.go +++ b/internal/services/securitycenter/security_center_subscription_pricing_resource_test.go @@ -86,7 +86,7 @@ resource "azurerm_security_center_subscription_pricing" "test" { } func (SecurityCenterSubscriptionPricingResource) storageAccountSubplan() string { - return fmt.Sprintf(` + return ` provider "azurerm" { features {} } @@ -96,5 +96,5 @@ resource "azurerm_security_center_subscription_pricing" "test" { resource_type = "StorageAccounts" subplan = "PerStorageAccount" } -`) +` } diff --git a/internal/services/securitycenter/security_center_workspace_resource.go b/internal/services/securitycenter/security_center_workspace_resource.go index f61c9cd77aaf..3debad6a6fea 100644 --- a/internal/services/securitycenter/security_center_workspace_resource.go +++ b/internal/services/securitycenter/security_center_workspace_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck "github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2020-08-01/workspaces" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/sentinel/client/client.go b/internal/services/sentinel/client/client.go index 01ad9e868b81..bd0511cba523 100644 --- a/internal/services/sentinel/client/client.go +++ b/internal/services/sentinel/client/client.go @@ -1,7 +1,7 @@ package client import ( - alertruletemplates "github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2021-09-01-preview/securityinsight" + alertruletemplates "github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2021-09-01-preview/securityinsight" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" securityinsight "github.com/tombuildsstuff/kermit/sdk/securityinsights/2022-10-01-preview/securityinsights" ) diff --git a/internal/services/sentinel/sentinel_alert_rule_template_data_source.go b/internal/services/sentinel/sentinel_alert_rule_template_data_source.go index 07639bdbd35c..f866e42c6990 100644 --- a/internal/services/sentinel/sentinel_alert_rule_template_data_source.go +++ b/internal/services/sentinel/sentinel_alert_rule_template_data_source.go @@ -6,7 +6,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2021-09-01-preview/securityinsight" + "github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2021-09-01-preview/securityinsight" // nolint: staticcheck "github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2020-08-01/workspaces" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/sentinel/parse" diff --git a/internal/services/servicebus/migration/namespace_network_rule_set.go b/internal/services/servicebus/migration/namespace_network_rule_set.go index 25ea9d3adf93..23899222acef 100644 --- a/internal/services/servicebus/migration/namespace_network_rule_set.go +++ b/internal/services/servicebus/migration/namespace_network_rule_set.go @@ -65,10 +65,7 @@ func (NamespaceNetworkRuleSetV0ToV1) Schema() map[string]*pluginsdk.Schema { func (NamespaceNetworkRuleSetV0ToV1) UpgradeFunc() pluginsdk.StateUpgraderFunc { return func(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) { // removing the constant URI suffix from the id since it isn't needed - oldId := rawState["id"].(string) - if strings.HasSuffix(oldId, "/networkrulesets/default") { - oldId = strings.TrimSuffix(oldId, "/networkrulesets/default") - } + oldId := strings.TrimSuffix(rawState["id"].(string), "/networkrulesets/default") id, err := namespaces.ParseNamespaceID(oldId) if err != nil { diff --git a/internal/services/servicebus/servicebus_namespace_resource.go b/internal/services/servicebus/servicebus_namespace_resource.go index e2b30daa6ec5..dc94e22091b6 100644 --- a/internal/services/servicebus/servicebus_namespace_resource.go +++ b/internal/services/servicebus/servicebus_namespace_resource.go @@ -317,30 +317,29 @@ func resourceServiceBusNamespaceRead(d *pluginsdk.ResourceData, meta interface{} } d.Set("sku", skuName) d.Set("capacity", sku.Capacity) - } - if props := model.Properties; model != nil { - d.Set("zone_redundant", props.ZoneRedundant) - if customerManagedKey, err := flattenServiceBusNamespaceEncryption(props.Encryption); err == nil { - d.Set("customer_managed_key", customerManagedKey) - } - localAuthEnabled := true - if props.DisableLocalAuth != nil { - localAuthEnabled = !*props.DisableLocalAuth - } - d.Set("local_auth_enabled", localAuthEnabled) + if props := model.Properties; props != nil { + d.Set("zone_redundant", props.ZoneRedundant) + if customerManagedKey, err := flattenServiceBusNamespaceEncryption(props.Encryption); err == nil { + d.Set("customer_managed_key", customerManagedKey) + } + localAuthEnabled := true + if props.DisableLocalAuth != nil { + localAuthEnabled = !*props.DisableLocalAuth + } + d.Set("local_auth_enabled", localAuthEnabled) - publicNetworkAccess := true - if props.PublicNetworkAccess != nil && *props.PublicNetworkAccess == namespaces.PublicNetworkAccessDisabled { - publicNetworkAccess = false - } - d.Set("public_network_access_enabled", publicNetworkAccess) + publicNetworkAccess := true + if props.PublicNetworkAccess != nil && *props.PublicNetworkAccess == namespaces.PublicNetworkAccessDisabled { + publicNetworkAccess = false + } + d.Set("public_network_access_enabled", publicNetworkAccess) - if props.MinimumTlsVersion != nil { - d.Set("minimum_tls_version", *props.MinimumTlsVersion) + if props.MinimumTlsVersion != nil { + d.Set("minimum_tls_version", *props.MinimumTlsVersion) + } } } - } authRuleId := namespacesauthorizationrule.NewAuthorizationRuleID(id.SubscriptionId, id.ResourceGroupName, id.NamespaceName, serviceBusNamespaceDefaultAuthorizationRule) diff --git a/internal/services/servicefabric/client/client.go b/internal/services/servicefabric/client/client.go index 166faeb3280d..b3716b370253 100644 --- a/internal/services/servicefabric/client/client.go +++ b/internal/services/servicefabric/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/servicefabric/mgmt/2021-06-01/servicefabric" + "github.com/Azure/azure-sdk-for-go/services/servicefabric/mgmt/2021-06-01/servicefabric" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/servicefabric/service_fabric_cluster_resource.go b/internal/services/servicefabric/service_fabric_cluster_resource.go index f9d94b2a8291..11621e93e8ae 100644 --- a/internal/services/servicefabric/service_fabric_cluster_resource.go +++ b/internal/services/servicefabric/service_fabric_cluster_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/servicefabric/mgmt/2021-06-01/servicefabric" + "github.com/Azure/azure-sdk-for-go/services/servicefabric/mgmt/2021-06-01/servicefabric" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/sql/client/client.go b/internal/services/sql/client/client.go index 67c0344d4bdf..9dde9084bf99 100644 --- a/internal/services/sql/client/client.go +++ b/internal/services/sql/client/client.go @@ -1,9 +1,9 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" - msi "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2018-06-01-preview/sql" - sqlv5 "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" // nolint: staticcheck + msi "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2018-06-01-preview/sql" // nolint: staticcheck + sqlv5 "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/sql/sql_administrator_resource.go b/internal/services/sql/sql_administrator_resource.go index 1148d5e2c97a..c4e1315beed7 100644 --- a/internal/services/sql/sql_administrator_resource.go +++ b/internal/services/sql/sql_administrator_resource.go @@ -6,7 +6,7 @@ import ( "net/http" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/gofrs/uuid" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/sql/sql_database_data_source.go b/internal/services/sql/sql_database_data_source.go index 16f5dde74472..77abcde6af0e 100644 --- a/internal/services/sql/sql_database_data_source.go +++ b/internal/services/sql/sql_database_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/sql/sql_database_resource.go b/internal/services/sql/sql_database_resource.go index ea35317ac584..858f598da3d7 100644 --- a/internal/services/sql/sql_database_resource.go +++ b/internal/services/sql/sql_database_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/gofrs/uuid" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" diff --git a/internal/services/sql/sql_elasticpool_resource.go b/internal/services/sql/sql_elasticpool_resource.go index 8e3710401b19..c03aec37bd09 100644 --- a/internal/services/sql/sql_elasticpool_resource.go +++ b/internal/services/sql/sql_elasticpool_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/sql/sql_failover_group_resource.go b/internal/services/sql/sql_failover_group_resource.go index fcf6c2dded68..1c2cfbecc368 100644 --- a/internal/services/sql/sql_failover_group_resource.go +++ b/internal/services/sql/sql_failover_group_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/sql/sql_firewall_rule_resource.go b/internal/services/sql/sql_firewall_rule_resource.go index 20cacee7d7f7..980813ba7c31 100644 --- a/internal/services/sql/sql_firewall_rule_resource.go +++ b/internal/services/sql/sql_firewall_rule_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/sql/sql_managed_database_resource.go b/internal/services/sql/sql_managed_database_resource.go index 4c62651cc7c7..0cf657547d2d 100644 --- a/internal/services/sql/sql_managed_database_resource.go +++ b/internal/services/sql/sql_managed_database_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2018-06-01-preview/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2018-06-01-preview/sql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/sql/sql_managed_instance_administrator_resource.go b/internal/services/sql/sql_managed_instance_administrator_resource.go index b25babed66ef..3de7c393e7e4 100644 --- a/internal/services/sql/sql_managed_instance_administrator_resource.go +++ b/internal/services/sql/sql_managed_instance_administrator_resource.go @@ -6,7 +6,7 @@ import ( "net/http" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/gofrs/uuid" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/sql/sql_managed_instance_failover_group_resource.go b/internal/services/sql/sql_managed_instance_failover_group_resource.go index 11ee87af7e29..4d48478f5c57 100644 --- a/internal/services/sql/sql_managed_instance_failover_group_resource.go +++ b/internal/services/sql/sql_managed_instance_failover_group_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" diff --git a/internal/services/sql/sql_managed_instance_resource.go b/internal/services/sql/sql_managed_instance_resource.go index a13476939a91..70daaa2d6d73 100644 --- a/internal/services/sql/sql_managed_instance_resource.go +++ b/internal/services/sql/sql_managed_instance_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/internal/services/sql/sql_server_resource.go b/internal/services/sql/sql_server_resource.go index 2448a6201a0e..c701c9a1b080 100644 --- a/internal/services/sql/sql_server_resource.go +++ b/internal/services/sql/sql_server_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/internal/services/sql/sql_virtual_network_rule_resource.go b/internal/services/sql/sql_virtual_network_rule_resource.go index 7667add65c98..b8214bdb5886 100644 --- a/internal/services/sql/sql_virtual_network_rule_resource.go +++ b/internal/services/sql/sql_virtual_network_rule_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/storage/client/client.go b/internal/services/storage/client/client.go index bc8fba59d889..a606a357c2c5 100644 --- a/internal/services/storage/client/client.go +++ b/internal/services/storage/client/client.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" - "github.com/Azure/azure-sdk-for-go/services/storagesync/mgmt/2020-03-01/storagesync" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/storagesync/mgmt/2020-03-01/storagesync" // nolint: staticcheck "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" storage_v2022_05_01 "github.com/hashicorp/go-azure-sdk/resource-manager/storage/2022-05-01" diff --git a/internal/services/storage/client/helpers.go b/internal/services/storage/client/helpers.go index b5e71616a125..fd35f8248343 100644 --- a/internal/services/storage/client/helpers.go +++ b/internal/services/storage/client/helpers.go @@ -6,7 +6,7 @@ import ( "log" "sync" - "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/parse" ) diff --git a/internal/services/storage/storage_account_customer_managed_key_resource.go b/internal/services/storage/storage_account_customer_managed_key_resource.go index 62463023a3e1..73ac73f7c27e 100644 --- a/internal/services/storage/storage_account_customer_managed_key_resource.go +++ b/internal/services/storage/storage_account_customer_managed_key_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/storage/storage_account_customer_managed_key_resource_test.go b/internal/services/storage/storage_account_customer_managed_key_resource_test.go index 3d81e9ee8dfc..ffcda2be2509 100644 --- a/internal/services/storage/storage_account_customer_managed_key_resource_test.go +++ b/internal/services/storage/storage_account_customer_managed_key_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/storage/storage_account_data_source.go b/internal/services/storage/storage_account_data_source.go index de41fc0786f6..3cb4e6b385b8 100644 --- a/internal/services/storage/storage_account_data_source.go +++ b/internal/services/storage/storage_account_data_source.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" // nolint: staticcheck azautorest "github.com/Azure/go-autorest/autorest" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" diff --git a/internal/services/storage/storage_account_network_rules_resource.go b/internal/services/storage/storage_account_network_rules_resource.go index 7703062e8531..d6a75172c349 100644 --- a/internal/services/storage/storage_account_network_rules_resource.go +++ b/internal/services/storage/storage_account_network_rules_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -44,7 +44,7 @@ func resourceStorageAccountNetworkRules() *pluginsdk.Resource { func resourceStorageAccountNetworkRulesSchema() map[string]*pluginsdk.Schema { return map[string]*pluginsdk.Schema{ - //lintignore: S013 + // lintignore: S013 "storage_account_id": { Type: pluginsdk.TypeString, Required: true, diff --git a/internal/services/storage/storage_account_resource.go b/internal/services/storage/storage_account_resource.go index 48cf2741f895..1ee77d9f1f38 100644 --- a/internal/services/storage/storage_account_resource.go +++ b/internal/services/storage/storage_account_resource.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" // nolint: staticcheck azautorest "github.com/Azure/go-autorest/autorest" autorestAzure "github.com/Azure/go-autorest/autorest/azure" "github.com/hashicorp/go-azure-helpers/lang/response" diff --git a/internal/services/storage/storage_account_resource_test.go b/internal/services/storage/storage_account_resource_test.go index 32c346469e2a..3200e7225b5d 100644 --- a/internal/services/storage/storage_account_resource_test.go +++ b/internal/services/storage/storage_account_resource_test.go @@ -1645,33 +1645,6 @@ resource "azurerm_storage_account" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomString, tlsVersion) } -func (r *StorageAccountResource) controlAllowNestedItemsToBePublic(data acceptance.TestData, allowFlag bool) string { - return fmt.Sprintf(` -provider "azurerm" { - features {} -} - -resource "azurerm_resource_group" "test" { - name = "acctestRG-storage-%d" - location = "%s" -} - -resource "azurerm_storage_account" "test" { - name = "unlikely23exst2acct%s" - resource_group_name = azurerm_resource_group.test.name - - location = azurerm_resource_group.test.location - account_tier = "Standard" - account_replication_type = "LRS" - allow_nested_items_to_be_public = %t - - tags = { - environment = "production" - } -} -`, data.RandomInteger, data.Locations.Primary, data.RandomString, allowFlag) -} - func (r StorageAccountResource) isHnsEnabledTrue(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { diff --git a/internal/services/storage/storage_blob_inventory_policy_resource.go b/internal/services/storage/storage_blob_inventory_policy_resource.go index 941587176560..c500e934cd2d 100644 --- a/internal/services/storage/storage_blob_inventory_policy_resource.go +++ b/internal/services/storage/storage_blob_inventory_policy_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/parse" diff --git a/internal/services/storage/storage_encryption_scope_resource.go b/internal/services/storage/storage_encryption_scope_resource.go index e6438a84e589..c8277fdc8528 100644 --- a/internal/services/storage/storage_encryption_scope_resource.go +++ b/internal/services/storage/storage_encryption_scope_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" keyVaultValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/validate" diff --git a/internal/services/storage/storage_encryption_scope_resource_test.go b/internal/services/storage/storage_encryption_scope_resource_test.go index 54ad7877c013..e6067ecd3a33 100644 --- a/internal/services/storage/storage_encryption_scope_resource_test.go +++ b/internal/services/storage/storage_encryption_scope_resource_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/storage/storage_management_policy_resource.go b/internal/services/storage/storage_management_policy_resource.go index e84c6980a9cf..a1e1ae14b012 100644 --- a/internal/services/storage/storage_management_policy_resource.go +++ b/internal/services/storage/storage_management_policy_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/parse" @@ -111,14 +111,14 @@ func resourceStorageManagementPolicy() *pluginsdk.Resource { }, }, }, - //lintignore:XS003 + // lintignore:XS003 "actions": { Type: pluginsdk.TypeList, Required: true, MaxItems: 1, Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ - //lintignore:XS003 + // lintignore:XS003 "base_blob": { Type: pluginsdk.TypeList, Optional: true, @@ -170,7 +170,7 @@ func resourceStorageManagementPolicy() *pluginsdk.Resource { }, }, }, - //lintignore:XS003 + // lintignore:XS003 "snapshot": { Type: pluginsdk.TypeList, Optional: true, diff --git a/internal/services/storage/storage_sync_cloud_endpoint_resource.go b/internal/services/storage/storage_sync_cloud_endpoint_resource.go index a6c7063e0c82..7b646c263fca 100644 --- a/internal/services/storage/storage_sync_cloud_endpoint_resource.go +++ b/internal/services/storage/storage_sync_cloud_endpoint_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/storagesync/mgmt/2020-03-01/storagesync" + "github.com/Azure/azure-sdk-for-go/services/storagesync/mgmt/2020-03-01/storagesync" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/parse" diff --git a/internal/services/storage/storage_sync_group_resource.go b/internal/services/storage/storage_sync_group_resource.go index 8071d615ce32..b045fa05ada9 100644 --- a/internal/services/storage/storage_sync_group_resource.go +++ b/internal/services/storage/storage_sync_group_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/storagesync/mgmt/2020-03-01/storagesync" + "github.com/Azure/azure-sdk-for-go/services/storagesync/mgmt/2020-03-01/storagesync" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/parse" diff --git a/internal/services/storage/storage_sync_resource.go b/internal/services/storage/storage_sync_resource.go index 91e28391fa39..1f2c23f89bc2 100644 --- a/internal/services/storage/storage_sync_resource.go +++ b/internal/services/storage/storage_sync_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/storagesync/mgmt/2020-03-01/storagesync" + "github.com/Azure/azure-sdk-for-go/services/storagesync/mgmt/2020-03-01/storagesync" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/streamanalytics/client/client.go b/internal/services/streamanalytics/client/client.go index 67ca2f180cda..9d9c54e61c00 100644 --- a/internal/services/streamanalytics/client/client.go +++ b/internal/services/streamanalytics/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" + "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/streamanalytics/helpers_input.go b/internal/services/streamanalytics/helpers_input.go index a21423c97ea3..a4b0bac12344 100644 --- a/internal/services/streamanalytics/helpers_input.go +++ b/internal/services/streamanalytics/helpers_input.go @@ -3,7 +3,7 @@ package streamanalytics import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" + "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/streamanalytics/helpers_output.go b/internal/services/streamanalytics/helpers_output.go index 856c8cc25dc4..a67312538b46 100644 --- a/internal/services/streamanalytics/helpers_output.go +++ b/internal/services/streamanalytics/helpers_output.go @@ -3,7 +3,7 @@ package streamanalytics import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" + "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/streamanalytics/stream_analytics_cluster_resource.go b/internal/services/streamanalytics/stream_analytics_cluster_resource.go index f5a5ab3d8e48..d1e44cf290c1 100644 --- a/internal/services/streamanalytics/stream_analytics_cluster_resource.go +++ b/internal/services/streamanalytics/stream_analytics_cluster_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" + "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" diff --git a/internal/services/streamanalytics/stream_analytics_function_javascript_uda_resource.go b/internal/services/streamanalytics/stream_analytics_function_javascript_uda_resource.go index 97d04c805858..b293ea557d89 100644 --- a/internal/services/streamanalytics/stream_analytics_function_javascript_uda_resource.go +++ b/internal/services/streamanalytics/stream_analytics_function_javascript_uda_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" + "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/streamanalytics/stream_analytics_function_javascript_udf_resource.go b/internal/services/streamanalytics/stream_analytics_function_javascript_udf_resource.go index 149c975bde75..442bd753cd28 100644 --- a/internal/services/streamanalytics/stream_analytics_function_javascript_udf_resource.go +++ b/internal/services/streamanalytics/stream_analytics_function_javascript_udf_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" + "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/streamanalytics/stream_analytics_job_resource.go b/internal/services/streamanalytics/stream_analytics_job_resource.go index ed99958ca6ee..a9f45f41b97c 100644 --- a/internal/services/streamanalytics/stream_analytics_job_resource.go +++ b/internal/services/streamanalytics/stream_analytics_job_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" + "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/internal/services/streamanalytics/stream_analytics_job_schedule_resource.go b/internal/services/streamanalytics/stream_analytics_job_schedule_resource.go index 1d52259843ed..6392086601a8 100644 --- a/internal/services/streamanalytics/stream_analytics_job_schedule_resource.go +++ b/internal/services/streamanalytics/stream_analytics_job_schedule_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" + "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" // nolint: staticcheck "github.com/Azure/go-autorest/autorest/date" "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" diff --git a/internal/services/streamanalytics/stream_analytics_managed_private_endpoint_resource.go b/internal/services/streamanalytics/stream_analytics_managed_private_endpoint_resource.go index 570d6aa0eecd..61ee9ce276e3 100644 --- a/internal/services/streamanalytics/stream_analytics_managed_private_endpoint_resource.go +++ b/internal/services/streamanalytics/stream_analytics_managed_private_endpoint_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" + "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/streamanalytics/parse" diff --git a/internal/services/streamanalytics/stream_analytics_output.go b/internal/services/streamanalytics/stream_analytics_output.go index 8bfe12c77665..dd17d53b63a1 100644 --- a/internal/services/streamanalytics/stream_analytics_output.go +++ b/internal/services/streamanalytics/stream_analytics_output.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" + "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/streamanalytics/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/streamanalytics/stream_analytics_output_blob_resource.go b/internal/services/streamanalytics/stream_analytics_output_blob_resource.go index 686266a261b8..3efc470f008a 100644 --- a/internal/services/streamanalytics/stream_analytics_output_blob_resource.go +++ b/internal/services/streamanalytics/stream_analytics_output_blob_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" + "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/streamanalytics/stream_analytics_output_cosmosdb_resource.go b/internal/services/streamanalytics/stream_analytics_output_cosmosdb_resource.go index 3c3f4f3bb833..9edc0989e4c2 100644 --- a/internal/services/streamanalytics/stream_analytics_output_cosmosdb_resource.go +++ b/internal/services/streamanalytics/stream_analytics_output_cosmosdb_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" + "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" diff --git a/internal/services/streamanalytics/stream_analytics_output_eventhub_resource.go b/internal/services/streamanalytics/stream_analytics_output_eventhub_resource.go index 5db898788a4d..16ea01ab6d9e 100644 --- a/internal/services/streamanalytics/stream_analytics_output_eventhub_resource.go +++ b/internal/services/streamanalytics/stream_analytics_output_eventhub_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" + "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/streamanalytics/stream_analytics_output_function_resource.go b/internal/services/streamanalytics/stream_analytics_output_function_resource.go index a2bf2d9a72cb..df59658bbc49 100644 --- a/internal/services/streamanalytics/stream_analytics_output_function_resource.go +++ b/internal/services/streamanalytics/stream_analytics_output_function_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" + "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/streamanalytics/parse" diff --git a/internal/services/streamanalytics/stream_analytics_output_mssql_resource.go b/internal/services/streamanalytics/stream_analytics_output_mssql_resource.go index 789cb2e6fe1b..4aa334b06aac 100644 --- a/internal/services/streamanalytics/stream_analytics_output_mssql_resource.go +++ b/internal/services/streamanalytics/stream_analytics_output_mssql_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" + "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/streamanalytics/stream_analytics_output_powerbi_resource.go b/internal/services/streamanalytics/stream_analytics_output_powerbi_resource.go index 9377820ab185..ab8085fbc8da 100644 --- a/internal/services/streamanalytics/stream_analytics_output_powerbi_resource.go +++ b/internal/services/streamanalytics/stream_analytics_output_powerbi_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" + "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" diff --git a/internal/services/streamanalytics/stream_analytics_output_servicebus_queue_resource.go b/internal/services/streamanalytics/stream_analytics_output_servicebus_queue_resource.go index 0279657bf78b..ae0346290b97 100644 --- a/internal/services/streamanalytics/stream_analytics_output_servicebus_queue_resource.go +++ b/internal/services/streamanalytics/stream_analytics_output_servicebus_queue_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" + "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/streamanalytics/stream_analytics_output_servicebus_topic_resource.go b/internal/services/streamanalytics/stream_analytics_output_servicebus_topic_resource.go index 51f7c73946b9..ba7e4ac1dbca 100644 --- a/internal/services/streamanalytics/stream_analytics_output_servicebus_topic_resource.go +++ b/internal/services/streamanalytics/stream_analytics_output_servicebus_topic_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" + "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/streamanalytics/stream_analytics_output_servicebus_topic_resource_test.go b/internal/services/streamanalytics/stream_analytics_output_servicebus_topic_resource_test.go index b9227e564298..67c7e47c864a 100644 --- a/internal/services/streamanalytics/stream_analytics_output_servicebus_topic_resource_test.go +++ b/internal/services/streamanalytics/stream_analytics_output_servicebus_topic_resource_test.go @@ -387,30 +387,6 @@ resource "azurerm_stream_analytics_output_servicebus_topic" "import" { `, template) } -func (r StreamAnalyticsOutputServiceBusTopicResource) authenticationMode(data acceptance.TestData) string { - template := r.template(data) - return fmt.Sprintf(` -%s - -resource "azurerm_stream_analytics_output_servicebus_topic" "test" { - name = "acctestoutput-%d" - stream_analytics_job_name = azurerm_stream_analytics_job.test.name - resource_group_name = azurerm_stream_analytics_job.test.resource_group_name - topic_name = azurerm_servicebus_topic.test.name - servicebus_namespace = azurerm_servicebus_namespace.test.name - shared_access_policy_key = azurerm_servicebus_namespace.test.default_primary_key - shared_access_policy_name = "RootManageSharedAccessKey" - authentication_mode = "Msi" - - serialization { - type = "Json" - encoding = "UTF8" - format = "LineSeparated" - } -} -`, template, data.RandomInteger) -} - func (r StreamAnalyticsOutputServiceBusTopicResource) template(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { diff --git a/internal/services/streamanalytics/stream_analytics_output_synapse_resource.go b/internal/services/streamanalytics/stream_analytics_output_synapse_resource.go index 30dabd45d5ce..cdb9d5496a05 100644 --- a/internal/services/streamanalytics/stream_analytics_output_synapse_resource.go +++ b/internal/services/streamanalytics/stream_analytics_output_synapse_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" + "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/streamanalytics/stream_analytics_output_table_resource.go b/internal/services/streamanalytics/stream_analytics_output_table_resource.go index f29d574e0e12..e39328f439af 100644 --- a/internal/services/streamanalytics/stream_analytics_output_table_resource.go +++ b/internal/services/streamanalytics/stream_analytics_output_table_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" + "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" @@ -147,7 +147,7 @@ func (r OutputTableResource) Create() sdk.ResourceFunc { BatchSize: utils.Int32(model.BatchSize), } - if v := model.ColumnsToRemove; v != nil && len(v) > 0 { + if v := model.ColumnsToRemove; len(v) > 0 { tableOutputProps.ColumnsToRemove = &v } diff --git a/internal/services/streamanalytics/stream_analytics_reference_input.go b/internal/services/streamanalytics/stream_analytics_reference_input.go index bd24cf919c7c..d3ac0402e513 100644 --- a/internal/services/streamanalytics/stream_analytics_reference_input.go +++ b/internal/services/streamanalytics/stream_analytics_reference_input.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" + "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" // nolint: staticcheck "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/streamanalytics/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/streamanalytics/stream_analytics_reference_input_blob_resource.go b/internal/services/streamanalytics/stream_analytics_reference_input_blob_resource.go index 3712dcceb5c5..7a07fe852f96 100644 --- a/internal/services/streamanalytics/stream_analytics_reference_input_blob_resource.go +++ b/internal/services/streamanalytics/stream_analytics_reference_input_blob_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" + "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/streamanalytics/stream_analytics_reference_input_mssql_resource.go b/internal/services/streamanalytics/stream_analytics_reference_input_mssql_resource.go index 255c893b90a2..de0536f82efa 100644 --- a/internal/services/streamanalytics/stream_analytics_reference_input_mssql_resource.go +++ b/internal/services/streamanalytics/stream_analytics_reference_input_mssql_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" + "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/streamanalytics/stream_analytics_reference_input_mssql_resource_test.go b/internal/services/streamanalytics/stream_analytics_reference_input_mssql_resource_test.go index 834dbf14f62a..33360b82e28b 100644 --- a/internal/services/streamanalytics/stream_analytics_reference_input_mssql_resource_test.go +++ b/internal/services/streamanalytics/stream_analytics_reference_input_mssql_resource_test.go @@ -152,32 +152,6 @@ QUERY `, template, data.RandomInteger) } -func (r StreamAnalyticsReferenceInputMsSqlResource) complete(data acceptance.TestData) string { - template := r.template(data) - return fmt.Sprintf(` -%s - -resource "azurerm_analytics_reference_input_mssql" "test" { - name = "acctestinput-%d" - stream_analytics_job_name = azurerm_stream_analytics_job.test.name - resource_group_name = azurerm_stream_analytics_job.test.resource_group_name - server = azurerm_mssql_server.test.fully_qualified_domain_name - database = azurerm_mssql_database.test.name - username = "maurice" - password = "ludicrousdisplay" - refresh_type = "RefreshPeriodicallyWithFull" - refresh_interval_duration = "00:10:00" - table = "exampletable" - full_snapshot_query = < subscriptionId := meta.(*clients.Client).Account.SubscriptionId" - echo " > id := parse.NewMyResourceId(subscriptionId, resourceGroup, name)" - echo "" - echo "This means that the 'SetID' function can change from:" - echo " > d.SetId(\"*read.ID\")" - echo "to:" - echo " > d.SetId(id.ID())" - echo "" - echo "In addition when parsing the Resource ID during a Read, Update or Delete method" - echo "the generated Resource ID Parser can be used via:" - echo " > id, err := parse.MyResourceID(d.Id())" - echo " > if err != nil {" - echo " > return err" - echo " > }" - echo "" - echo "New Resources should be using Resource ID Formatters/Parsers by default" - echo "however existing (unmodified) resources can continue to use the Azure ID" - echo "for the moment - but over time these will be switched across." - exit 1 - } + echo "The Feature Flag for 'ShouldResourcesBeImported' will be deprecated in the future" + echo "and shouldn't be used in new resources - please remove new usages of the" + echo "'ShouldResourcesBeImported' function from these changes - since this is now enabled" + echo "by default." + echo "" + echo "In the future this function will be marked as Deprecated - however it's not for" + echo "the moment to not conflict with open Pull Requests." + exit 1 + } - # check for new combined CreateUpdate methods - line=$(grep -H -n "Create:.*CreateUpdate," "$f" -m1) - if [ "$line" != "" ]; - then - git diff --diff-filter=AMRC origin/main -U0 "$f" | grep -q "+.*Create:.*CreateUpdate," && { - echo "$line" - echo "New Resources should no longer use combined CreateUpdate methods, please" - echo "split these into two separate Create and Update methods." - echo "" - echo "Existing resources can continue to use combined CreateUpdate methods" - echo "for the moment - but over time these will be split into separate Create and" - echo "Update methods." - exit 1 + # using Resource ID Formatters/Parsers + grep -H -n "d\.SetId(\\*" "$f" && { + echo "Due to the Azure API returning the Resource ID's inconsistently - Terraform" + echo "now manages it's own Resource ID's, all new resources should use a generated" + echo "Resource ID Formatter and Parser." + echo "" + echo "A Resource ID Formatter and Parser can be generated by adding a 'resourceids.go'" + echo "file to the service package (for example" + echo "./internal/services/myservice/resourceids.go) - with the line:" + echo + echo "//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=Server" + echo "-id={the value of the Resource ID}" + echo "" + echo "At which point running 'make generate' will generate a Resource ID Formatter, Parser" + echo "and Validator." + echo "" + echo "This allows a Resource ID to be defined in-line via:" + echo " > subscriptionId := meta.(*clients.Client).Account.SubscriptionId" + echo " > id := parse.NewMyResourceId(subscriptionId, resourceGroup, name)" + echo "" + echo "This means that the 'SetID' function can change from:" + echo " > d.SetId(\"*read.ID\")" + echo "to:" + echo " > d.SetId(id.ID())" + echo "" + echo "In addition when parsing the Resource ID during a Read, Update or Delete method" + echo "the generated Resource ID Parser can be used via:" + echo " > id, err := parse.MyResourceID(d.Id())" + echo " > if err != nil {" + echo " > return err" + echo " > }" + echo "" + echo "New Resources should be using Resource ID Formatters/Parsers by default" + echo "however existing (unmodified) resources can continue to use the Azure ID" + echo "for the moment - but over time these will be switched across." + exit 1 } - fi - # check for d.Get inside Delete - deleteFuncName=$(grep -o "Delete: .*," "$f" -m1 | grep -o " .*Delete"| tr -d " ") - if [ "$deleteFuncName" != "" ]; - then - deleteMethod=$(cat -n $f | sed -n -e "/func $deleteFuncName.*$/,/[[:digit:]]*\treturn nil/{ /func $deleteFuncName$/d; /[[:digit:]]*\treturn nil/d; p; }") - foundGet=$(echo "$deleteMethod" | grep "d\.Get(.*)" -m1) - if [ "$foundGet" != "" ]; + # check for new combined CreateUpdate methods + line=$(grep -H -n "Create:.*CreateUpdate," "$f" -m1) + if [ "$line" != "" ]; then - echo "$f $foundGet" - echo "Please do not use 'd.Get' within the Delete function as this does not work as expected in Delete" - exit 1 + git diff --diff-filter=AMRC origin/main -U0 "$f" | grep -q "+.*Create:.*CreateUpdate," && { + echo "$line" + echo "New Resources should no longer use combined CreateUpdate methods, please" + echo "split these into two separate Create and Update methods." + echo "" + echo "Existing resources can continue to use combined CreateUpdate methods" + echo "for the moment - but over time these will be split into separate Create and" + echo "Update methods." + exit 1 + } fi - else - # check for Get in typed resource - deleteFuncName=" Delete() sdk.ResourceFunc " - deleteMethod=$(cat -n $f | sed -n -e "/$deleteFuncName.*$/,/[[:digit:]]*\t\t\treturn nil/{ /$deleteFuncName.*$/d; /[[:digit:]]*\t\t\treturn nil/d; p; }") - foundGet=$(echo "$deleteMethod" | grep "metadata.ResourceData.Get" -m1) - if [ "$foundGet" != "" ]; + + # check for d.Get inside Delete + deleteFuncName=$(grep -o "Delete: .*," "$f" -m1 | grep -o " .*Delete"| tr -d " ") + if [ "$deleteFuncName" != "" ]; then - echo "$f $foundGet" - echo "Please do not use 'metadata.ResourceData.Get' within the Delete function as this does not work as expected in Delete" - exit 1 + deleteMethod=$(cat -n $f | sed -n -e "/func $deleteFuncName.*$/,/[[:digit:]]*\treturn nil/{ /func $deleteFuncName$/d; /[[:digit:]]*\treturn nil/d; p; }") + foundGet=$(echo "$deleteMethod" | grep "d\.Get(.*)" -m1) + if [ "$foundGet" != "" ]; + then + echo "$f $foundGet" + echo "Please do not use 'd.Get' within the Delete function as this does not work as expected in Delete" + exit 1 + fi + else + # check for Get in typed resource + deleteFuncName=" Delete() sdk.ResourceFunc " + deleteMethod=$(cat -n $f | sed -n -e "/$deleteFuncName.*$/,/[[:digit:]]*\t\t\treturn nil/{ /$deleteFuncName.*$/d; /[[:digit:]]*\t\t\treturn nil/d; p; }") + foundGet=$(echo "$deleteMethod" | grep "metadata.ResourceData.Get" -m1) + if [ "$foundGet" != "" ]; + then + echo "$f $foundGet" + echo "Please do not use 'metadata.ResourceData.Get' within the Delete function as this does not work as expected in Delete" + exit 1 + fi fi - fi -done + done } function checkForUnclearErrorMessages {