Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

modules: update go makefile with modules support #63

Closed
wants to merge 1 commit into from

Conversation

hasheddan
Copy link
Contributor

This commit updates the go init portion of the makefile to support go modules. It is in preparation for migrating Crossplane to go modules: #534

Signed-off-by: hasheddan [email protected]

This commit updates the go init portion of the makefile to support go modules

Signed-off-by: hasheddan <[email protected]>
Copy link
Contributor

@displague displague left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to see the counter-part crossplane PR in place for a full review.

@if ! `$(GO) version | grep -q -E '\bgo($(GO_SUPPORTED_VERSIONS))\b'`; then \
$(ERR) unsupported go version. Please make install one of the following supported version: '$(GO_SUPPORTED_VERSIONS)' ;\
exit 1 ;\
fi
ifeq ($(GO11MODULE),on)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! In response to the Crossplane PR, it is a strict dependency on build, so it would just be scaffolding until this was merged. Last time I brought this effort forward I don't think we had it as top of priority, but I would be willing to make another push for it!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My interest resurfaced when I needed to make a PR on this repo.

This PR doesn't affect me directly now. The follow-up may be a little more involved than expected. In my own tinkering with go-mod on the crossplane project I've noticed that the packages that are <1.0.0 have been updated to their latest version by go mod init which has introduced some deprecations to address:

GO111MODULE=on make
make go.mod
08:56:45 [ .. ] go mod tidy
==> Linting /home/marques/src/crossplane/cluster/charts/crossplane
[INFO] Chart.yaml: icon is recommended

1 chart(s) linted, no failures
08:56:45 [ .. ] golangci-lint
pkg/clients/gcp/cloudsql/instance.go:49:18: SA1019: sqladmin.New is deprecated: please use NewService instead. To provide a custom HTTP client, use option.WithHTTPClient. If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.  (staticcheck)
        service, err := sqladmin.New(oauth2.NewClient(ctx, creds.TokenSource))
                        ^
pkg/clients/gcp/cloudsql/user.go:46:18: SA1019: sqladmin.New is deprecated: please use NewService instead. To provide a custom HTTP client, use option.WithHTTPClient. If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.  (staticcheck)
        service, err := sqladmin.New(oauth2.NewClient(ctx, creds.TokenSource))
                        ^
pkg/clients/gcp/gcp.go:135:21: SA1019: cloudresourcemanager.New is deprecated: please use NewService instead. To provide a custom HTTP client, use option.WithHTTPClient. If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.  (staticcheck)
        crmService, err := cloudresourcemanager.New(client)
                           ^
pkg/clients/gcp/gcp.go:165:21: SA1019: cloudresourcemanager.New is deprecated: please use NewService instead. To provide a custom HTTP client, use option.WithHTTPClient. If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.  (staticcheck)
        crmService, err := cloudresourcemanager.New(client)
                           ^
pkg/clients/gcp/gke/gke.go:54:17: SA1019: container.New is deprecated: please use NewService instead. To provide a custom HTTP client, use option.WithHTTPClient. If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.  (staticcheck)
        client, err := container.New(oauth2.NewClient(context.Background(), creds.TokenSource))
                       ^
08:56:54 [FAIL]
make[2]: *** [build/makelib/golang.mk:198: go.lint] Error 1
make[1]: *** [build/makelib/common.mk:301: build.all] Error 2
make: *** [build/makelib/common.mk:311: build] Error 2

@negz
Copy link
Member

negz commented Oct 7, 2019

Should this be closed now that #74 is merged?

@hasheddan hasheddan closed this Oct 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants