From 57932e187bd166540bf582d5354a23140f7a6767 Mon Sep 17 00:00:00 2001 From: Alex Pilon Date: Mon, 7 Jan 2019 17:06:18 -0500 Subject: [PATCH] provider: Require Go 1.11 in TravisCI and README provider: Run go fix provider: Run go fmt --- .travis.yml | 2 +- github/data_source_github_ip_ranges.go | 8 ++-- github/data_source_github_team.go | 12 +++--- github/data_source_github_user.go | 38 +++++++++---------- github/provider.go | 8 ++-- .../resource_github_organization_webhook.go | 2 +- .../resource_github_repository_deploy_key.go | 8 ++-- 7 files changed, 39 insertions(+), 39 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7d3bdf2ed2..e85a5f222b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ services: - docker language: go go: -- "1.10.x" + - "1.11.x" install: # This script is used by the Travis build to install a cookie for diff --git a/github/data_source_github_ip_ranges.go b/github/data_source_github_ip_ranges.go index 2608592d21..6bf25914c2 100644 --- a/github/data_source_github_ip_ranges.go +++ b/github/data_source_github_ip_ranges.go @@ -9,22 +9,22 @@ func dataSourceGithubIpRanges() *schema.Resource { Read: dataSourceGithubIpRangesRead, Schema: map[string]*schema.Schema{ - "hooks": &schema.Schema{ + "hooks": { Type: schema.TypeList, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, }, - "git": &schema.Schema{ + "git": { Type: schema.TypeList, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, }, - "pages": &schema.Schema{ + "pages": { Type: schema.TypeList, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, }, - "importer": &schema.Schema{ + "importer": { Type: schema.TypeList, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, diff --git a/github/data_source_github_team.go b/github/data_source_github_team.go index f59e42abbe..5848c4bb50 100644 --- a/github/data_source_github_team.go +++ b/github/data_source_github_team.go @@ -15,27 +15,27 @@ func dataSourceGithubTeam() *schema.Resource { Read: dataSourceGithubTeamRead, Schema: map[string]*schema.Schema{ - "slug": &schema.Schema{ + "slug": { Type: schema.TypeString, Required: true, }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Computed: true, }, - "privacy": &schema.Schema{ + "privacy": { Type: schema.TypeString, Computed: true, }, - "permission": &schema.Schema{ + "permission": { Type: schema.TypeString, Computed: true, }, - "members": &schema.Schema{ + "members": { Type: schema.TypeList, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, diff --git a/github/data_source_github_user.go b/github/data_source_github_user.go index 76725f2076..11b3104cb9 100644 --- a/github/data_source_github_user.go +++ b/github/data_source_github_user.go @@ -13,81 +13,81 @@ func dataSourceGithubUser() *schema.Resource { Read: dataSourceGithubUserRead, Schema: map[string]*schema.Schema{ - "username": &schema.Schema{ + "username": { Type: schema.TypeString, Required: true, }, - "login": &schema.Schema{ + "login": { Type: schema.TypeString, Computed: true, }, - "avatar_url": &schema.Schema{ + "avatar_url": { Type: schema.TypeString, Computed: true, }, - "gravatar_id": &schema.Schema{ + "gravatar_id": { Type: schema.TypeString, Computed: true, }, - "site_admin": &schema.Schema{ + "site_admin": { Type: schema.TypeBool, Computed: true, }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, }, - "company": &schema.Schema{ + "company": { Type: schema.TypeString, Computed: true, }, - "blog": &schema.Schema{ + "blog": { Type: schema.TypeString, Computed: true, }, - "location": &schema.Schema{ + "location": { Type: schema.TypeString, Computed: true, }, - "email": &schema.Schema{ + "email": { Type: schema.TypeString, Computed: true, }, - "bio": &schema.Schema{ + "bio": { Type: schema.TypeString, Computed: true, }, - "gpg_keys": &schema.Schema{ + "gpg_keys": { Type: schema.TypeList, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, }, - "ssh_keys": &schema.Schema{ + "ssh_keys": { Type: schema.TypeList, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, }, - "public_repos": &schema.Schema{ + "public_repos": { Type: schema.TypeInt, Computed: true, }, - "public_gists": &schema.Schema{ + "public_gists": { Type: schema.TypeInt, Computed: true, }, - "followers": &schema.Schema{ + "followers": { Type: schema.TypeInt, Computed: true, }, - "following": &schema.Schema{ + "following": { Type: schema.TypeInt, Computed: true, }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, }, - "updated_at": &schema.Schema{ + "updated_at": { Type: schema.TypeString, Computed: true, }, diff --git a/github/provider.go b/github/provider.go index e178ba2b12..fccd150bf0 100644 --- a/github/provider.go +++ b/github/provider.go @@ -9,25 +9,25 @@ func Provider() terraform.ResourceProvider { var p *schema.Provider p = &schema.Provider{ Schema: map[string]*schema.Schema{ - "token": &schema.Schema{ + "token": { Type: schema.TypeString, Required: true, DefaultFunc: schema.EnvDefaultFunc("GITHUB_TOKEN", nil), Description: descriptions["token"], }, - "organization": &schema.Schema{ + "organization": { Type: schema.TypeString, Required: true, DefaultFunc: schema.EnvDefaultFunc("GITHUB_ORGANIZATION", nil), Description: descriptions["organization"], }, - "base_url": &schema.Schema{ + "base_url": { Type: schema.TypeString, Optional: true, DefaultFunc: schema.EnvDefaultFunc("GITHUB_BASE_URL", ""), Description: descriptions["base_url"], }, - "insecure": &schema.Schema{ + "insecure": { Type: schema.TypeBool, Optional: true, Default: false, diff --git a/github/resource_github_organization_webhook.go b/github/resource_github_organization_webhook.go index 375e4e346b..a7bbf344bc 100644 --- a/github/resource_github_organization_webhook.go +++ b/github/resource_github_organization_webhook.go @@ -29,7 +29,7 @@ func resourceGithubOrganizationWebhook() *schema.Resource { ForceNew: true, ValidateFunc: validateGithubOrganizationWebhookName, }, - "events": &schema.Schema{ + "events": { Type: schema.TypeSet, Required: true, Elem: &schema.Schema{Type: schema.TypeString}, diff --git a/github/resource_github_repository_deploy_key.go b/github/resource_github_repository_deploy_key.go index c9d62186fe..0c77867b07 100644 --- a/github/resource_github_repository_deploy_key.go +++ b/github/resource_github_repository_deploy_key.go @@ -23,24 +23,24 @@ func resourceGithubRepositoryDeployKey() *schema.Resource { // Deploy keys are defined immutable in the API. Updating results in force new. Schema: map[string]*schema.Schema{ - "key": &schema.Schema{ + "key": { Type: schema.TypeString, Required: true, ForceNew: true, DiffSuppressFunc: suppressDeployKeyDiff, }, - "read_only": &schema.Schema{ + "read_only": { Type: schema.TypeBool, Optional: true, ForceNew: true, Default: true, }, - "repository": &schema.Schema{ + "repository": { Type: schema.TypeString, Required: true, ForceNew: true, }, - "title": &schema.Schema{ + "title": { Type: schema.TypeString, Required: true, ForceNew: true,