Skip to content

Commit

Permalink
Upgraded golint to 1.55.2 (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
merlimat authored Jun 24, 2024
1 parent 1e24010 commit 4bf3368
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.21

- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.43.0
version: v1.55.2
args: --timeout=5m

# Optional: working directory, useful for monorepos
Expand Down
40 changes: 20 additions & 20 deletions pkg/admin/dummy.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
)

// NewDummyPulsarAdmin is a dummy initialization function
func NewDummyPulsarAdmin(config PulsarAdminConfig) (PulsarAdmin, error) {
func NewDummyPulsarAdmin(PulsarAdminConfig) (PulsarAdmin, error) {
return &DummyPulsarAdmin{}, nil
}

Expand All @@ -30,52 +30,52 @@ type DummyPulsarAdmin struct {
var _ PulsarAdmin = &DummyPulsarAdmin{}

// ApplyTenant is a fake implements of ApplyTenant
func (d *DummyPulsarAdmin) ApplyTenant(name string, params *TenantParams) error {
func (d *DummyPulsarAdmin) ApplyTenant(string, *TenantParams) error {
return nil
}

// DeleteTenant is a fake implements of DeleteTenant
func (d *DummyPulsarAdmin) DeleteTenant(name string) error {
func (d *DummyPulsarAdmin) DeleteTenant(string) error {
return nil
}

// ApplyNamespace is a fake implements of ApplyNamespace
func (d *DummyPulsarAdmin) ApplyNamespace(name string, params *NamespaceParams) error {
func (d *DummyPulsarAdmin) ApplyNamespace(string, *NamespaceParams) error {
return nil
}

// DeleteNamespace is a fake implements of DeleteNamespace
func (d *DummyPulsarAdmin) DeleteNamespace(name string) error {
func (d *DummyPulsarAdmin) DeleteNamespace(string) error {
return nil
}

// GetNamespaceClusters is a fake implements of GetNamespaceClusters
func (d *DummyPulsarAdmin) GetNamespaceClusters(name string) ([]string, error) {
func (d *DummyPulsarAdmin) GetNamespaceClusters(string) ([]string, error) {
return []string{}, nil
}

// SetNamespaceClusters is a fake implements of SetNamespaceClusters
func (d *DummyPulsarAdmin) SetNamespaceClusters(name string, clusters []string) error {
func (d *DummyPulsarAdmin) SetNamespaceClusters(string, []string) error {
return nil
}

// ApplyTopic is a fake implements of ApplyTopic
func (d *DummyPulsarAdmin) ApplyTopic(name string, params *TopicParams) error {
func (d *DummyPulsarAdmin) ApplyTopic(string, *TopicParams) error {
return nil
}

// DeleteTopic is a fake implements of DeleteTopic
func (d *DummyPulsarAdmin) DeleteTopic(name string) error {
func (d *DummyPulsarAdmin) DeleteTopic(string) error {
return nil
}

// GetTopicClusters is a fake implements of GetTopicClusters
func (d *DummyPulsarAdmin) GetTopicClusters(name string, persistent *bool) ([]string, error) {
func (d *DummyPulsarAdmin) GetTopicClusters(string, *bool) ([]string, error) {
return []string{}, nil
}

// SetTopicClusters is a fake implements of SetTopicClusters
func (d *DummyPulsarAdmin) SetTopicClusters(name string, persistent *bool, clusters []string) error {
func (d *DummyPulsarAdmin) SetTopicClusters(string, *bool, []string) error {
return nil
}

Expand All @@ -85,46 +85,46 @@ func (d *DummyPulsarAdmin) Close() error {
}

// GrantPermissions is a fake implements of GrantPermissions
func (d *DummyPulsarAdmin) GrantPermissions(p Permissioner) error {
func (d *DummyPulsarAdmin) GrantPermissions(Permissioner) error {
return nil
}

// RevokePermissions is a fake implements of RevokePermissions
func (d *DummyPulsarAdmin) RevokePermissions(p Permissioner) error {
func (d *DummyPulsarAdmin) RevokePermissions(Permissioner) error {
return nil
}

// GetSchema is a fake implements of GetSchema
func (d *DummyPulsarAdmin) GetSchema(topic string) (*v1alpha1.SchemaInfo, error) {
func (d *DummyPulsarAdmin) GetSchema(string) (*v1alpha1.SchemaInfo, error) {
return nil, nil
}

// UploadSchema is a fake implements of UploadSchema
func (d *DummyPulsarAdmin) UploadSchema(topic string, params *SchemaParams) error {
func (d *DummyPulsarAdmin) UploadSchema(string, *SchemaParams) error {
return nil
}

// DeleteSchema is a fake implements of DeleteSchema
func (d *DummyPulsarAdmin) DeleteSchema(topic string) error {
func (d *DummyPulsarAdmin) DeleteSchema(string) error {
return nil
}

// CreateCluster is a fake implements of CreateCluster
func (d *DummyPulsarAdmin) CreateCluster(name string, param *ClusterParams) error {
func (d *DummyPulsarAdmin) CreateCluster(string, *ClusterParams) error {
return nil
}

// UpdateCluster is a fake implements of UpdateCluster
func (d *DummyPulsarAdmin) UpdateCluster(name string, param *ClusterParams) error {
func (d *DummyPulsarAdmin) UpdateCluster(string, *ClusterParams) error {
return nil
}

// DeleteCluster is a fake implements of DeleteCluster
func (d *DummyPulsarAdmin) DeleteCluster(name string) error {
func (d *DummyPulsarAdmin) DeleteCluster(string) error {
return nil
}

// CheckClusterExist checks whether the cluster exists
func (d *DummyPulsarAdmin) CheckClusterExist(name string) (bool, error) {
func (d *DummyPulsarAdmin) CheckClusterExist(string) (bool, error) {
return true, nil
}
4 changes: 2 additions & 2 deletions pkg/reconciler/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ type Dummy struct {
}

// Observe is a fake implements of Observe
func (d *Dummy) Observe(ctx context.Context) error {
func (d *Dummy) Observe(context.Context) error {
return nil
}

// Reconcile is a fake implements of Reconcile
func (d *Dummy) Reconcile(ctx context.Context) error {
func (d *Dummy) Reconcile(context.Context) error {
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export POP_HOME=`cd $BINDIR/..;pwd`

if [ ! -f ${POP_HOME}/bin/golangci-lint ]; then
cd ${POP_HOME}
wget -O - -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.43.0
wget -O - -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.55.2
cd -
fi
${POP_HOME}/bin/golangci-lint --version
Expand Down
8 changes: 5 additions & 3 deletions tests/go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
module github.com/streamnative/pulsar-resources-operator/tests

go 1.18
go 1.21

toolchain go1.22.3

require (
// pulsar-client-go latest version is v0.9.0,
// it removed the go.mod from oauth2, this will cause the issue of ambiguous import
github.com/apache/pulsar-client-go v0.9.1-0.20230925013839-ac9c1a639933
github.com/apache/pulsar-client-go v0.12.1
github.com/onsi/ginkgo/v2 v2.1.3
github.com/onsi/gomega v1.19.0
github.com/sirupsen/logrus v1.8.1
Expand All @@ -30,7 +32,7 @@ require (
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/danieljoos/wincred v1.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dvsekhvalnov/jose2go v1.5.0 // indirect
github.com/dvsekhvalnov/jose2go v1.6.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/go-logr/logr v1.2.1 // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
Expand Down
2 changes: 2 additions & 0 deletions tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/apache/pulsar-client-go v0.9.1-0.20230925013839-ac9c1a639933 h1:lYWPZnfWZZ/OZO0kS/WhNS/vmujPrT9fmuPse3X/ecc=
github.com/apache/pulsar-client-go v0.9.1-0.20230925013839-ac9c1a639933/go.mod h1:Ea/yiZA7plgiaWRyOuO1B0k5/hjpl1thmiKig+D9PBQ=
github.com/apache/pulsar-client-go v0.12.1/go.mod h1:dkutuH4oS2pXiGm+Ti7fQZ4MRjrMPZ8IJeEGAWMeckk=
github.com/ardielle/ardielle-go v1.5.2 h1:TilHTpHIQJ27R1Tl/iITBzMwiUGSlVfiVhwDNGM3Zj4=
github.com/ardielle/ardielle-go v1.5.2/go.mod h1:I4hy1n795cUhaVt/ojz83SNVCYIGsAFAONtv2Dr7HUI=
github.com/ardielle/ardielle-tools v1.5.4/go.mod h1:oZN+JRMnqGiIhrzkRN9l26Cej9dEx4jeNG6A+AdkShk=
Expand Down Expand Up @@ -116,6 +117,7 @@ github.com/dimfeld/httptreemux v5.0.1+incompatible/go.mod h1:rbUlSV+CCpv/SuqUTP/
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM=
github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU=
github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU=
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153 h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc=
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
Expand Down

0 comments on commit 4bf3368

Please sign in to comment.