Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/vet: incorrect detection of self-assignment #22174

Closed
klauspost opened this issue Oct 7, 2017 · 2 comments
Closed

cmd/vet: incorrect detection of self-assignment #22174

klauspost opened this issue Oct 7, 2017 · 2 comments
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@klauspost
Copy link
Contributor

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

>go version
go version go1.9.1 windows/amd64

Does this issue reproduce with the latest release?

Yes

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

set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=d:\dev\gopath\
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=e:\temp\wintemp\go-build563293679=/tmp/go-build -gno-record-gcc-switches
set CXX=g++
set CGO_ENABLED=1
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config

What did you do?

Save https://play.golang.org/p/d5JNE7rvLc to main.go
Execute go vet main.go

What did you expect to see?

Nothing. The code is not self-assigning.

What did you see instead?

main.go:11: self-assignment of s[rng.Intn(len(s))] to s[rng.Intn(len(s))]
exit status 1
@ianlancetaylor ianlancetaylor changed the title cmd/vet: Wrong detection of self-assignment cmd/vet: incorrect detection of self-assignment Oct 7, 2017
@ianlancetaylor ianlancetaylor added the NeedsFix The path to resolution is known, but the work has not been done. label Oct 7, 2017
@ianlancetaylor ianlancetaylor added this to the Go1.10 milestone Oct 7, 2017
@mvdan
Copy link
Member

mvdan commented Oct 8, 2017

I'll take a stab at this later.

@mvdan mvdan self-assigned this Oct 8, 2017
@gopherbot
Copy link

Change https://golang.org/cl/69116 mentions this issue: cmd/vet: skip self-assigns that contain any calls

@golang golang locked and limited conversation to collaborators Oct 9, 2018
@rsc rsc unassigned mvdan Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants