Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

govendor -> go modules #70

Merged
merged 6 commits into from
Mar 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
31 changes: 31 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
issues:
max-per-linter: 0
max-same-issues: 0

linters:
disable-all: true
enable:
- deadcode
- errcheck
- gofmt
- gosimple
- govet
- ineffassign
- interfacer
- nakedret
- misspell
- staticcheck
- structcheck
- typecheck
- unused
- unconvert
- varcheck
- vet
- vetshadow

linters-settings:
errcheck:
ignore: github.com/hashicorp/terraform/helper/schema:ForceNew|Set,fmt:.*,io:Close

run:
modules-download-mode: vendor
30 changes: 0 additions & 30 deletions .gometalinter.json

This file was deleted.

25 changes: 12 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
dist: trusty
sudo: required
services:
- docker
- docker
language: go
go:
- "1.11.x"

install:
# This script is used by the Travis build to install a cookie for
# go.googlesource.com so rate limits are higher when using `go get` to fetch
# packages that live there.
# See: https://github.com/golang/go/issues/12933
- bash scripts/gogetcookie.sh
- make tools
# This script is used by the Travis build to install a cookie for
# go.googlesource.com so rate limits are higher when using `go get` to fetch
# packages that live there.
# See: https://github.com/golang/go/issues/12933
- bash scripts/gogetcookie.sh
- make tools

script:
- make lint
- make test
- make vendor-status
- make website-test
- make test
- make lint
- make website-test

branches:
only:
- master
- master
matrix:
fast_finish: true
allow_failures:
- go: tip
- go: tip
19 changes: 11 additions & 8 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ PKG_NAME=azurestack

#make sure we catch schema errors during testing
TF_SCHEMA_PANIC_ON_ERROR=1
GO111MODULE=on
GOFLAGS=-mod=vendor

default: build

Expand Down Expand Up @@ -36,18 +38,19 @@ fmt:
fmtcheck:
@sh "$(CURDIR)/scripts/gofmtcheck.sh"

goimport:
@echo "==> Fixing imports code with goimports..."
goimports -w $(PKG_NAME)/

lint:
@echo "==> Checking source code against linters..."
@gometalinter ./$(PKG_NAME)
golangci-lint run ./...

tools:
@echo "==> installing required tooling..."
go get -u github.com/kardianos/govendor
go get -u github.com/alecthomas/gometalinter
gometalinter --install

vendor-status:
@govendor status
@sh "$(CURDIR)/scripts/gogetcookie.sh"
GO111MODULE=off go get -u github.com/client9/misspell/cmd/misspell
GO111MODULE=off go get -u github.com/golangci/golangci-lint/cmd/golangci-lint

test-compile:
@if [ "$(TEST)" = "./..." ]; then \
Expand All @@ -71,5 +74,5 @@ ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
endif
@$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider-test PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)

.PHONY: build build-docker test test-docker testacc vet fmt fmtcheck errcheck vendor-status test-compile website website-test
.PHONY: build build-docker test test-docker testacc vet fmt fmtcheck errcheck test-compile website website-test

7 changes: 2 additions & 5 deletions azurestack/helpers/azure/resourceid.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ func ParseAzureResourceID(id string) (*ResourceID, error) {
path := idURL.Path

path = strings.TrimSpace(path)
if strings.HasPrefix(path, "/") {
path = path[1:]
}

path = strings.TrimPrefix(path, "/")
if strings.HasSuffix(path, "/") {
path = path[:len(path)-1]
}
Expand Down Expand Up @@ -132,7 +129,7 @@ func composeAzureResourceID(idObj *ResourceID) (id string, err error) {
}
}

return
return id, err
}

func ParseNetworkSecurityGroupName(networkSecurityGroupId string) (string, error) {
Expand Down
33 changes: 33 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module github.com/terraform-providers/terraform-provider-azurestack

go 1.12

require (
github.com/Azure/azure-sdk-for-go v21.3.0+incompatible
github.com/Azure/go-autorest v10.15.4+incompatible
github.com/apparentlymart/go-cidr v1.0.0 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/davecgh/go-spew v1.1.1
github.com/dnaeon/go-vcr v1.0.1 // indirect
github.com/hashicorp/errwrap v1.0.0
github.com/hashicorp/go-azure-helpers v0.0.0-20181211121309-38db96513363
github.com/hashicorp/go-getter v1.2.0 // indirect
github.com/hashicorp/go-hclog v0.8.0 // indirect
github.com/hashicorp/go-plugin v0.0.0-20190220160451-3f118e8ee104 // indirect
github.com/hashicorp/go-uuid v1.0.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/hcl2 v0.0.0-20190305174554-fdf8e232b64f // indirect
github.com/hashicorp/hil v0.0.0-20190212132231-97b3a9cdfa93 // indirect
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/terraform v0.11.3
github.com/marstr/guid v0.0.0-20170427235115-8bdf7d1a087c // indirect
github.com/mitchellh/cli v1.0.0 // indirect
github.com/mitchellh/copystructure v1.0.0 // indirect
github.com/mitchellh/hashstructure v1.0.0 // indirect
github.com/satori/go.uuid v0.0.0-20160927100844-b061729afc07 // indirect
github.com/terraform-providers/terraform-provider-azurerm v1.15.0
github.com/zclconf/go-cty v0.0.0-20190212192503-19dda139b164 // indirect
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
golang.org/x/net v0.0.0-20190311183353-d8887717615a // indirect
golang.org/x/sys v0.0.0-20190312061237-fead79001313 // indirect
)
Loading