Duncan-tree-zhou commented on PR #66:
URL: https://github.com/apache/skywalking-swck/pull/66#issuecomment-1175222342

   I get some problem to run golangci-lint locally.
   
   ``` sh
   ╰$ cd ./operater
   ╰$ make lint
   
   /Users/duncan/gitRepo/skywalking-swck/hack/build/../../bin/golangci-lint run 
-v --config /Users/duncan/gitRepo/skywalking-swck/hack/build/../../golangci.yml
   INFO [config_reader] Used config file ../golangci.yml 
   INFO [lintersdb] Active 17 linters: [deadcode errcheck goconst goimports 
gosimple govet ineffassign lll misspell prealloc revive staticcheck structcheck 
typecheck unconvert unused varcheck] 
   INFO [loader] Go packages loading at mode 575 
(files|imports|exports_file|name|types_sizes|compiled_files|deps) took 
801.788651ms 
   INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 2.755238ms 
   INFO [linters context/goanalysis] analyzers took 11.692135ms with top 10 
stages: fact_deprecated: 445.095µs, deadcode: 443.551µs, atomic: 428.73µs, 
SA5003: 365.506µs, SA5002: 359.546µs, unusedresult: 325.001µs, SA9004: 
319.219µs, copylocks: 302.732µs, buildir: 177.701µs, SA1029: 139.714µs 
   INFO [runner/max_same_issues] 3/6 issues with text "r.Name undefined (type 
*Satellite has no field or method Name)" were hidden, use --max-same-issues 
   INFO [runner/max_same_issues] 2/5 issues with text "r.Name undefined (type 
*Fetcher has no field or method Name)" were hidden, use --max-same-issues 
   INFO [runner/max_same_issues] 2/5 issues with text "r.Name undefined (type 
*UI has no field or method Name)" were hidden, use --max-same-issues 
   INFO [runner/max_same_issues] 2/5 issues with text "r.Name undefined (type 
*OAPServer has no field or method Name)" were hidden, use --max-same-issues 
   INFO [runner/max_same_issues] 2/5 issues with text "r.Name undefined (type 
*Storage has no field or method Name)" were hidden, use --max-same-issues 
   INFO [runner/max_same_issues] 1/4 issues with text "r.Name undefined (type 
*JavaAgent has no field or method Name)" were hidden, use --max-same-issues 
   INFO [runner/max_same_issues] 1/4 issues with text "r.Name undefined (type 
*SwAgent has no field or method Name)" were hidden, use --max-same-issues 
   INFO [runner] Issues before processing: 7884, after processing: 37 
   INFO [runner] Processors filtering stat (out/in): path_prettifier: 
7884/7884, skip_files: 7884/7884, exclude: 7884/7884, diff: 50/50, source_code: 
37/37, path_shortener: 37/37, cgo: 7884/7884, filename_unadjuster: 7884/7884, 
autogenerated_exclude: 7884/7884, sort_results: 37/37, skip_dirs: 7884/7884, 
identifier_marker: 7884/7884, nolint: 7884/7884, uniq_by_line: 50/7884, 
max_per_file_from_linter: 50/50, max_from_linter: 37/37, severity-rules: 37/37, 
exclude-rules: 7884/7884, max_same_issues: 37/50, path_prefixer: 37/37 
   INFO [runner] processing took 431.568894ms with stages: exclude-rules: 
278.769184ms, identifier_marker: 139.037053ms, nolint: 5.487976ms, 
path_prettifier: 3.551225ms, exclude: 1.713702ms, skip_dirs: 765.035µs, cgo: 
704.837µs, uniq_by_line: 430.471µs, filename_unadjuster: 345.089µs, 
source_code: 330.496µs, autogenerated_exclude: 271.369µs, max_same_issues: 
149.215µs, path_shortener: 5.516µs, max_from_linter: 3.425µs, 
max_per_file_from_linter: 3.047µs, skip_files: 332ns, sort_results: 300ns, 
diff: 284ns, severity-rules: 227ns, path_prefixer: 111ns 
   INFO [runner] linters took 3.298307217s with stages: goanalysis_metalinter: 
2.866343824s 
   apis/operator/v1alpha1/fetcher_webhook.go:45:39: r.Name undefined (type 
*Fetcher has no field or method Name) (typecheck)
           fetcherlog.Info("default", "name", r.Name)
                                                ^
   apis/operator/v1alpha1/fetcher_webhook.go:47:26: r.Name undefined (type 
*Fetcher has no field or method Name) (typecheck)
                   r.Spec.ClusterName = r.Name
                                          ^
   apis/operator/v1alpha1/fetcher_webhook.go:58:47: r.Name undefined (type 
*Fetcher has no field or method Name) (typecheck)
           fetcherlog.Info("validate create", "name", r.Name)
                                                        ^
   apis/operator/v1alpha1/javaagent_webhook.go:51:41: r.Name undefined (type 
*JavaAgent has no field or method Name) (typecheck)
           javaagentlog.Info("default", "name", r.Name)
                                                  ^
   apis/operator/v1alpha1/javaagent_webhook.go:76:49: r.Name undefined (type 
*JavaAgent has no field or method Name) (typecheck)
           javaagentlog.Info("validate create", "name", r.Name)
                                                          ^
   apis/operator/v1alpha1/javaagent_webhook.go:82:49: r.Name undefined (type 
*JavaAgent has no field or method Name) (typecheck)
           javaagentlog.Info("validate update", "name", r.Name)
                                                          ^
   apis/operator/v1alpha1/oapserver_webhook.go:47:41: r.Name undefined (type 
*OAPServer has no field or method Name) (typecheck)
           oapserverlog.Info("default", "name", r.Name)
                                                  ^
   apis/operator/v1alpha1/oapserver_webhook.go:58:60: r.Name undefined (type 
*OAPServer has no field or method Name) (typecheck)
                                   "--set 
meshConfig.enableEnvoyAccessLogService=true", r.Name, r.Namespace)
                                                                                
          ^
   apis/operator/v1alpha1/oapserver_webhook.go:56:6: r.Annotations undefined 
(type *OAPServer has no field or method Annotations) (typecheck)
                           r.Annotations[annotationKeyIstioSetup] = 
fmt.Sprintf("istioctl install --set profile=demo "+
                             ^
   apis/operator/v1alpha1/oapserver_webhook.go:70:49: r.Name undefined (type 
*OAPServer has no field or method Name) (typecheck)
           oapserverlog.Info("validate create", "name", r.Name)
                                                          ^
   apis/operator/v1alpha1/satellite_webhook.go:45:41: r.Name undefined (type 
*Satellite has no field or method Name) (typecheck)
           satellitelog.Info("default", "name", r.Name)
                                                  ^
   apis/operator/v1alpha1/satellite_webhook.go:54:28: r.Name undefined (type 
*Satellite has no field or method Name) (typecheck)
                   r.Spec.OAPServerName = r.Name
                                            ^
   apis/operator/v1alpha1/satellite_webhook.go:60:59: r.Name undefined (type 
*Satellite has no field or method Name) (typecheck)
                           "--set meshConfig.enableEnvoyAccessLogService=true", 
r.Name, r.Namespace)
                                                                                
  ^
   apis/operator/v1alpha1/satellite_webhook.go:58:5: r.Annotations undefined 
(type *Satellite has no field or method Annotations) (typecheck)
                   r.Annotations[annotationKeyIstioSetup] = 
fmt.Sprintf("istioctl install --set profile=demo "+
                     ^
   apis/operator/v1alpha1/storage_webhook.go:46:39: r.Name undefined (type 
*Storage has no field or method Name) (typecheck)
           storagelog.Info("default", "name", r.Name)
                                                ^
   apis/operator/v1alpha1/storage_webhook.go:64:47: r.Name undefined (type 
*Storage has no field or method Name) (typecheck)
           storagelog.Info("validate create", "name", r.Name)
                                                        ^
   apis/operator/v1alpha1/storage_webhook.go:70:47: r.Name undefined (type 
*Storage has no field or method Name) (typecheck)
           storagelog.Info("validate update", "name", r.Name)
                                                        ^
   apis/operator/v1alpha1/storage_webhook.go:98:30: r.GroupVersionKind 
undefined (type *Storage has no field or method GroupVersionKind) (typecheck)
                           schema.GroupKind{Group: r.GroupVersionKind().Group, 
Kind: r.GroupVersionKind().Kind},
                                                     ^
   apis/operator/v1alpha1/swagent_webhook.go:46:39: r.Name undefined (type 
*SwAgent has no field or method Name) (typecheck)
           swagentlog.Info("default", "name", r.Name)
                                                ^
   apis/operator/v1alpha1/swagent_webhook.go:57:47: r.Name undefined (type 
*SwAgent has no field or method Name) (typecheck)
           swagentlog.Info("validate create", "name", r.Name)
                                                        ^
   apis/operator/v1alpha1/swagent_webhook.go:64:47: r.Name undefined (type 
*SwAgent has no field or method Name) (typecheck)
           swagentlog.Info("validate update", "name", r.Name)
                                                        ^
   apis/operator/v1alpha1/ui_webhook.go:45:34: r.Name undefined (type *UI has 
no field or method Name) (typecheck)
           uilog.Info("default", "name", r.Name)
                                           ^
   apis/operator/v1alpha1/ui_webhook.go:53:69: r.Name undefined (type *UI has 
no field or method Name) (typecheck)
                   r.Spec.OAPServerAddress = 
fmt.Sprintf("http://%s-oap.%s:12800";, r.Name, r.Namespace)
                                                                                
     ^
   apis/operator/v1alpha1/ui_webhook.go:64:42: r.Name undefined (type *UI has 
no field or method Name) (typecheck)
           uilog.Info("validate create", "name", r.Name)
                                                   ^
   pkg/kubernetes/kubernetes.go:27:2: could not import unicode (-: could not 
load export data: cannot import "unicode" (unstable iexport format version 2, 
just rebuild compiler and std library), export data is newer version - update 
tool) (typecheck)
           "unicode"
           ^
   pkg/kubernetes/apply.go:105:11: a.Get undefined (type *Application has no 
field or method Get) (typecheck)
           err := a.Get(ctx, key, current)
                    ^
   pkg/kubernetes/apply.go:117:14: a.Create undefined (type *Application has no 
field or method Create) (typecheck)
                   if err = a.Create(ctx, obj); err != nil {
                              ^
   pkg/kubernetes/apply.go:140:14: a.Update undefined (type *Application has no 
field or method Update) (typecheck)
           if err := a.Update(ctx, obj); err != nil {
                       ^
   pkg/kubernetes/kubernetes.go:70:9: undeclared name: `sprig` (typecheck)
                   Funcs(sprig.TxtFuncMap())
                         ^
   pkg/kubernetes/kubernetes.go:29:2: "github.com/Masterminds/sprig/v3" 
imported but not used (typecheck)
           "github.com/Masterminds/sprig/v3"
           ^
   controllers/operator/fetcher_controller.go:107:14: r.Status undefined (type 
*FetcherReconciler has no field or method Status) (typecheck)
           if err := r.Status().Update(ctx, fetcher); err != nil {
                       ^
   controllers/operator/javaagent_controller.go:185:14: r.List undefined (type 
*JavaAgentReconciler has no field or method List) (typecheck)
           if err := r.List(ctx, podList, opts...); err != nil && 
!apierrors.IsNotFound(err) {
                       ^
   controllers/operator/javaagent_controller.go:216:14: r.Status undefined 
(type *JavaAgentReconciler has no field or method Status) (typecheck)
           if err := r.Status().Update(ctx, javaagent); err != nil {
                       ^
   controllers/operator/oapserver_controller.go:122:14: r.Status undefined 
(type *OAPServerReconciler has no field or method Status) (typecheck)
           if err := r.Status().Update(ctx, oapServer); err != nil {
                       ^
   controllers/operator/satellite_controller.go:108:14: r.Status undefined 
(type *SatelliteReconciler has no field or method Status) (typecheck)
           if err := r.Status().Update(ctx, satellite); err != nil {
                       ^
   controllers/operator/storage_controller.go:147:14: r.Status undefined (type 
*StorageReconciler has no field or method Status) (typecheck)
           if err := r.Status().Update(ctx, storage); err != nil {
                       ^
   controllers/operator/ui_controller.go:118:14: r.Status undefined (type 
*UIReconciler has no field or method Status) (typecheck)
           if err := r.Status().Update(ctx, ui); err != nil {
                       ^
   INFO File cache stats: 15 entries of total size 75.4KiB 
   INFO Memory: 43 samples, avg is 289.7MB, max is 431.8MB 
   INFO Execution took 4.118953382s                  
   make: *** [lint] Error 1
   
   ```
   
   it only failed in my local `make lint`,but it pass in github action. In both 
env using the same version of golangci-lint and the same config file... 
   
   I am not quite familiar with golangci-lint, Do you have any ideas?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to