Skip to content

After the Mac is installed locally, the scanning results are inconsistent with those obtained by running commands from official images #5096

@fjzcxs

Description

@fjzcxs

Welcome

  • Yes, I'm using a binary release within 2 latest releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've read the typecheck section of the FAQ.
  • Yes, I've tried with the standalone linter if available (e.g., gocritic, go vet, etc.).
  • I agree to follow this project's Code of Conduct

Description of the problem

After the Mac is installed locally, the scanning results are inconsistent with those obtained by running commands from official images, And for both I am using the latest version 1.61.0.
After installing the scan with mac local brew, I think it contains the correct scan results, and the plugin contains errcheck, gosimple, govet, etc., which are turned on by default6, but the result rules of scanning after using the official image in the local docker run only contain typecheck, why do you scan the same project but have different results

Version of golangci-lint

Details
$ golangci-lint --version
# golangci-lint has version 1.61.0 built with go1.23.1 from a1d6c56 on 2024-09-09T14:33:19Z

Configuration

Details
# Use the default configuration

Go environment

Details
$ go version && go env
# go version go1.21.5 darwin/amd64

Verbose output of running

Details

Here's the different output for both of the cases described

nternal/storage/logs.go:5:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package [io] or package [os], and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
        "io/ioutil"
        ^
internal/client/gateway/gateway.go:50:11: printf: fmt.Errorf format %s reads arg #2, but call has 1 arg (govet)
                        return fmt.Errorf("%s Unexpected data type: %s\n", string(bodyData))
                               ^
internal/client/gateway/gateway.go:54:3: ineffectual assignment to innerData (ineffassign)
                innerData = commonData
                ^
internal/user/user_controller.go:41:2: S1023: redundant `return` statement (gosimple)
        return
        ^
internal/client/monitorClient/monitor.go:322:25: printf: non-constant format string in call to fmt.Errorf (govet)
                return "", fmt.Errorf(res.Dat[monitorName].(string))
                                      ^
internal/user/service/user_service.go:178:2: unreachable: unreachable code (govet)
        return false
        ^
internal/middleware/logincheck.go:42:6: S1002: should omit comparison to bool constant, can be simplified to `passLogin(c)` (gosimple)
                if passLogin(c) == true {
                   ^
internal/scan/main/main.go:34:2: SA5000: assignment to nil map (staticcheck)
        m["key"] = 10 // 在nil map上进行写操作
        ^
internal/scan/main/main.go:54:2: SA9003: empty branch (staticcheck)
        if err == nil {
        ^
internal/common/init.go:202:6: S1002: should omit comparison to bool constant, can be simplified to `cluster.Spec.MainCluster` (gosimple)
                if cluster.Spec.MainCluster == true {
                   ^
internal/common/global.go:281:2: S1008: should use 'return clusterType == clusterv1beta1.AliyunASK' instead of 'if clusterType == clusterv1beta1.AliyunASK { return true }; return false' (gosimple)
        if clusterType == clusterv1beta1.AliyunASK {
        ^
pkg/tekton/apis/config/store.go:90:15: s.UntypedLoad undefined (type *Store has no field or method UntypedLoad) (typecheck)
		Defaults: s.UntypedLoad(DefaultsConfigName).(*Defaults).DeepCopy(),
		            ^
pkg/tekton/apis/pipeline/v1alpha1/artifact_bucket.go:73:40: pr.Name undefined (type *PipelineRun has no field or method Name) (typecheck)
	return fmt.Sprintf("%s-%s-bucket", pr.Name, pr.Namespace)
	                                      ^
pkg/tekton/apis/pipeline/v1alpha1/build_gcs_resource.go:81:99: r.Name undefined (type *PipelineResource has no field or method Name) (typecheck)
		return nil, xerrors.Errorf("BuildGCSResource: %s cannot support artifacts on private bucket", r.Name)
		                                                                                                ^
pkg/tekton/apis/pipeline/v1alpha1/build_gcs_resource.go:93:62: r.Name undefined (type *PipelineResource has no field or method Name) (typecheck)
				return nil, xerrors.Errorf("BuildGCSResource %s : %w", r.Name, err)
				                                                         ^
pkg/tekton/apis/pipeline/v1alpha1/build_gcs_resource.go:98:123: r.Name undefined (type *PipelineResource has no field or method Name) (typecheck)
		return nil, xerrors.Errorf("BuildGCSResource: Need Location to be specified in order to create BuildGCS resource %s", r.Name)
		                                                                                                                        ^
pkg/tekton/apis/pipeline/v1alpha1/cluster_task_validation.go:26:37: t.GetObjectMeta undefined (type *ClusterTask has no field or method GetObjectMeta) (typecheck)
	if err := validateObjectMetadata(t.GetObjectMeta()); err != nil {
	                                   ^
pkg/tekton/apis/pipeline/v1alpha1/condition_validation.go:27:37: c.GetObjectMeta undefined (type Condition has no field or method GetObjectMeta) (typecheck)
	if err := validateObjectMetadata(c.GetObjectMeta()); err != nil {
	                                   ^
pkg/tekton/apis/pipeline/v1alpha1/merge.go:83:30: s.Args undefined (type Step has no field or method Args) (typecheck)
		if merged.Args == nil && s.Args != nil {
		                           ^
pkg/tekton/apis/pipeline/v1alpha1/pipeline_validation.go:32:37: p.GetObjectMeta undefined (type *Pipeline has no field or method GetObjectMeta) (typecheck)
	if err := validateObjectMetadata(p.GetObjectMeta()); err != nil {
	                                   ^
pkg/tekton/apis/pipeline/v1alpha1/pipelineresource_validation.go:28:37: r.GetObjectMeta undefined (type *PipelineResource has no field or method GetObjectMeta) (typecheck)
	if err := validateObjectMetadata(r.GetObjectMeta()); err != nil {
	                                   ^
pkg/tekton/apis/pipeline/v1alpha1/pipelinerun_types.go:220:18: pr.Namespace undefined (type *PipelineRun has no field or method Namespace) (typecheck)
		Namespace:  pr.Namespace,

A minimal reproducible example or link to a public repository

Details
// Not yet

Validation

  • Yes, I've included all information above (version, config, etc.).

Supporter

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions