Skip to content

Commit

Permalink
Use go 1.19
Browse files Browse the repository at this point in the history
The change mostly consists of a bunch of `//` having been inserted by
the upgraded `go fmt`.

For compatibility's sake, I've left go.mod still supporting 1.18, but
all lint rules and the like are now using 1.19.

This resolves #2681.
  • Loading branch information
Robin Sonefors committed Sep 6, 2022
1 parent 3957cc0 commit 7a75690
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 53 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.18.X]
go-version: [1.19.X]
steps:
- uses: actions/checkout@v2
- name: Go modules cache
Expand All @@ -79,7 +79,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.18.X]
go-version: [1.19.X]
node-version: [16.X]
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -215,7 +215,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.18.X
go-version: 1.19.X
- name: Checkout code
uses: actions/checkout@v2
- name: Clean
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prepare-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.18.X
go-version: 1.19.X
- name: Setup Node.js
uses: actions/setup-node@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.18.X
go-version: 1.19.X
- name: Use Node.js
uses: actions/setup-node@v1
with:
Expand Down
4 changes: 3 additions & 1 deletion core/clustersmngr/clustersmngr.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ func (e ClusterNotFoundError) Error() string {
return fmt.Sprintf("cluster=%s not found", e.Cluster)
}

//ClusterFetcher fetches all leaf clusters
// ClusterFetcher fetches all leaf clusters
//
//counterfeiter:generate . ClusterFetcher
type ClusterFetcher interface {
Fetch(ctx context.Context) ([]Cluster, error)
}

// ClientsPool stores all clients to the leaf clusters
//
//counterfeiter:generate . ClientsPool
type ClientsPool interface {
Add(cfg ClusterClientConfigFunc, cluster Cluster) error
Expand Down
1 change: 1 addition & 0 deletions core/nsaccess/nsaccess.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ var DefautltWegoAppRules = []rbacv1.PolicyRule{
}

// Checker contains methods for validing user access to Kubernetes namespaces, based on a set of PolicyRules
//
//counterfeiter:generate . Checker
type Checker interface {
// FilterAccessibleNamespaces returns a filtered list of namespaces to which a user has access to
Expand Down
2 changes: 1 addition & 1 deletion doc/development-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Depending on your area of focus we're providing guidance of each kind of develop

Step one, you **must** have the following things installed:

* [go](https://go.dev) v1.17 -- Primary development language.
* [go](https://go.dev) v1.19 -- Primary development language.
* [docker](https://www.docker.com/) -- Used for generating containers & testing kubernetes set-ups.
* [helm](https://helm.sh/docs/intro/install/) v3. -- Package manager for kubernetes
* [kind](https://kind.sigs.k8s.io/docs/user/quick-start#installation) -- Run kubernetes clusters in docker for testing.
Expand Down
14 changes: 0 additions & 14 deletions pkg/api/applications/applications_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 0 additions & 32 deletions pkg/api/core/core_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func GetProfilesPath(clusterName, profilesManifestPath string) string {

// Git is an interface for basic Git operations on a single branch of a
// remote repository.
//
//counterfeiter:generate . Git
type Git interface {
Open(path string) (*gogit.Repository, error)
Expand Down
1 change: 1 addition & 0 deletions pkg/gitproviders/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const (
var ErrRepositoryNoPermissionsOrDoesNotExist = errors.New("no permissions to access this repository or repository doesn't exists")

// GitProvider Handler
//
//counterfeiter:generate . GitProvider
type GitProvider interface {
RepositoryExists(ctx context.Context, repoUrl RepoURL) (bool, error)
Expand Down
1 change: 1 addition & 0 deletions pkg/helm/watcher/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type profileVersion = string
type ValueMap map[profileName]map[profileVersion][]byte

// Cache defines an interface to work with the profile data cacher.
//
//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
//counterfeiter:generate . Cache
type Cache interface {
Expand Down
1 change: 1 addition & 0 deletions pkg/helm/watcher/controller/helm_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const (
)

// EventRecorder defines an external event recorder's function for creating events for the notification controller.
//
//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
//counterfeiter:generate . eventRecorder
type eventRecorder interface {
Expand Down
1 change: 1 addition & 0 deletions pkg/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate

// Runner is an entity which can execute commands with whatever backing medium behind it.
//
//counterfeiter:generate . Runner
type Runner interface {
// Run takes a command name and some arguments and will apply it to the current environment.
Expand Down
1 change: 1 addition & 0 deletions pkg/services/auth/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type Claims struct {
}

// JWTClient represents a type that has methods to generate and verify JWT tokens.
//
//counterfeiter:generate . JWTClient
type JWTClient interface {
GenerateJWT(expirationTime time.Duration, providerName gitproviders.GitProviderName, providerToken string) (string, error)
Expand Down
1 change: 1 addition & 0 deletions pkg/services/auth/types/flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate

// AuthFlow is an interface for OAuth authorization flows
//
//counterfeiter:generate . AuthFlow
type AuthFlow interface {
Authorize(ctx context.Context) (*http.Request, error)
Expand Down

0 comments on commit 7a75690

Please sign in to comment.