golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.66k stars 17.62k forks source link

x/tools/gopls: mismatch "uml" package for the "models" package and mistakenly reports an error #48626

Closed thomaspeugeot closed 3 years ago

thomaspeugeot commented 3 years ago

What version of Go are you using (go version)?

$ go version
go version go1.17.1 darwin/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/thomaspeugeot/Library/Caches/go-build"
GOENV="/Users/thomaspeugeot/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/thomaspeugeot/go/pkg/mod"
GONOPROXY="github.com/thomaspeugeot,github.com/fullstack-lang"
GONOSUMDB="github.com/thomaspeugeot,github.com/fullstack-lang"
GOOS="darwin"
GOPATH="/Users/thomaspeugeot/go"
GOPRIVATE="github.com/thomaspeugeot,github.com/fullstack-lang"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.17.1"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/thomaspeugeot/go/src/github.com/fullstack-lang/laundromat/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/_r/bxjvdzc17mb6p56qc7nms1r80000gn/T/go-build87726630=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

thomaspeugeot@MacBook-Pro-de-Thomas ng % cd /tmp
thomaspeugeot@MacBook-Pro-de-Thomas /tmp % git clone https://github.com/fullstack-lang/laundromat
Cloning into 'laundromat'...
remote: Enumerating objects: 435, done.
remote: Counting objects: 100% (435/435), done.
remote: Compressing objects: 100% (225/225), done.
remote: Total 435 (delta 247), reused 378 (delta 190), pack-reused 0
Receiving objects: 100% (435/435), 992.00 KiB | 1.04 MiB/s, done.
Resolving deltas: 100% (247/247), done.
thomaspeugeot@MacBook-Pro-de-Thomas /tmp % cd laundromat 
thomaspeugeot@MacBook-Pro-de-Thomas laundromat % code .

What did you expect to see?

A vscode screen with 0 problems reported

What did you see instead?

2 problems reported in files

go/diagrams/states_Machine.go go/diagrams/states_Washer.go

Screenshot 2021-09-25 at 17 36 45
seankhliao commented 3 years ago

I believe the error reported is correct (go build also fails). Did you want to use UmlState ?

thomaspeugeot commented 3 years ago

@seankhliao , Sorry, yes, it was UmlState. I apologize for not checking this before. It happens this code is later compiled by go/types without issues, therefore, I thought the problem was with gopls, not go/types. I close the issue.