gopls version
Build info
golang.org/x/tools/gopls v0.16.1 golang.org/x/tools/gopls@v0.16.1 h1:1hO/dCeUvjEYx3V0rVvCtOkwnpEpqS29paE+Jw4dcAc= golang.org/x/exp/typeparams@v0.0.0-20221212164502-fae10dda9338 h1:2O2DON6y3XMJiQRAS1UWU+54aec2uopH3x7MAiqGW6Y= golang.org/x/mod@v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= golang.org/x/sync@v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= golang.org/x/telemetry@v0.0.0-20240607193123-221703e18637 h1:3Wt8mZlbFwG8llny+t18kh7AXxyWePFycXMuVdHxnyM= golang.org/x/text@v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/tools@v0.22.1-0.20240628205440-9c895dd76b34 h1:Kd+Z5Pm6uwYx3T2KEkeHMHUMZxDPb/q6b1m+zEcy62c= golang.org/x/vuln@v1.0.4 h1:SP0mPeg2PmGCu03V+61EcQiOjmpri2XijexKdzv8Z1I= honnef.co/go/tools@v0.4.7 h1:9MDAWxMoSnB6QoSqiVr7P5mtkT9pOc1kSxchzPCnqJs= mvdan.cc/xurls/v2@v2.5.0 h1:lyBNOm8Wo71UknhUs4QTFUNNMyxy2JEIaKKo0RWOh+8= go: go1.19
go env
GO111MODULE='on'
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/violapioggia/Library/Caches/go-build'
GOENV='/Users/violapioggia/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/violapioggia/go/pkg/mod'
GONOPROXY='talkcheap.xiaoeknow.com'
GONOSUMDB='talkcheap.xiaoeknow.com'
GOOS='darwin'
GOPATH='/Users/violapioggia/go'
GOPRIVATE='talkcheap.xiaoeknow.com'
GOPROXY='https://goproxy.cn,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.21.1'
GCCGO='gccgo'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/2y/q5hfz55n7yx__bgtrj0pwgpw0000gn/T/go-build3276859780=/tmp/go-build -gno-record-gcc-switches -fno-common'
What did you do?
What did you see happen?
In this case, I add my own code logic UserService.Hello()
, and there is an error: undefined: UserService
What did you expect to see?
I want to add my own code logic that can not be distinguished by gopls, now I want to find a way to let gopls filter error, Is there any configurations ? Please tell me, thanks.
Editor and settings
No response
Logs
No response
Comment From: gabyhelp
Related Issues and Documentation
- x/tools/gopls: negated build flag causes error #59346
- x/tools/gopls: undeclared name when accessing symbols from other files #35337 (closed)
- x/tools/gopls: #52425 (closed)
- x/tools/gopls: strange output with gopls >= 0.3.0, no actual errors detected #37046 (closed)
- x/tools/gopls: Implement action should ignore importing the current package #61830 (closed)
- x/tools/gopls: missing semantic tokens for function parameters in block #56257 (closed)
- x/tools/gopls: bad state after creating new directory and package #37978 (closed)
- x/tools/gopls: invalid errors when using "pkgm" VS Code snippet #39296 (closed)
- x/tools/gopls: show error message if nested module is not root #38089 (closed)
- x/tools/gopls: references doesn't work properly. #60676 (closed)
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Comment From: ViolaPioggia
Related Issues and Documentation
- x/tools/gopls: negated build flag causes error #59346
- x/tools/gopls: undeclared name when accessing symbols from other files #35337 (closed)
- x/tools/gopls: #52425 (closed)
- x/tools/gopls: strange output with gopls >= 0.3.0, no actual errors detected #37046 (closed)
- x/tools/gopls: Implement action should ignore importing the current package #61830 (closed)
- x/tools/gopls: missing semantic tokens for function parameters in block #56257 (closed)
- x/tools/gopls: bad state after creating new directory and package #37978 (closed)
- x/tools/gopls: invalid errors when using "pkgm" VS Code snippet #39296 (closed)
- x/tools/gopls: show error message if nested module is not root #38089 (closed)
- x/tools/gopls: references doesn't work properly. #60676 (closed)
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
sry, it can't help me
Comment From: seankhliao
Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.
For questions please refer to https://github.com/golang/go/wiki/Questions