fix staticcheck issues

add staticcheck CI action

add staticcheck in Makefile

Signed-off-by: roywang <seiwy2010@gmail.com>
This commit is contained in:
roy wang
2021-01-29 18:42:03 +09:00
committed by roywang
parent af61a81828
commit 93ae8a9099
43 changed files with 136 additions and 115 deletions
+2 -3
View File
@@ -13,7 +13,6 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2"
corev1alpha2 "github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2"
"github.com/oam-dev/kubevela/apis/types"
util2 "github.com/oam-dev/kubevela/pkg/commands/util"
@@ -25,7 +24,7 @@ import (
"github.com/oam-dev/kubevela/pkg/utils/system"
)
// nolint
// DescriptionUndefined indicates the description is not defined
const DescriptionUndefined = "description not defined"
// GetCapabilitiesFromCluster will get capability from K8s cluster
@@ -108,7 +107,7 @@ func GetTraitsFromCluster(ctx context.Context, namespace string, c types.Args, s
}
// validateCapabilities validates whether helm charts are successful installed, GVK are successfully retrieved.
func validateCapabilities(tmp types.Capability, dm discoverymapper.DiscoveryMapper, definitionName string, reference v1alpha2.DefinitionReference) (types.Capability, error) {
func validateCapabilities(tmp types.Capability, dm discoverymapper.DiscoveryMapper, definitionName string, reference corev1alpha2.DefinitionReference) (types.Capability, error) {
var err error
if tmp.Install != nil {
tmp.Source = &types.Source{ChartName: tmp.Install.Helm.Name}
+1 -1
View File
@@ -51,7 +51,7 @@ func TestAPIs(t *testing.T) {
}
var _ = BeforeSuite(func(done Done) {
logf.SetLogger(zap.LoggerTo(GinkgoWriter, true))
logf.SetLogger(zap.New(zap.UseDevMode(true), zap.WriteTo(GinkgoWriter)))
ctx := context.Background()
By("bootstrapping test environment")
useExistCluster := false