1
// Copyright 2013 The Go Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style
3
// license that can be found in the LICENSE file.
5
// This file contains tests for the useless-assignment checker.
15
func (s *ST) SetX(x int) {
16
// Accidental self-assignment; it should be "s.x = x"
17
x = x // ERROR "self-assignment of x to x"
19
s.x = s.x // ERROR "self-assignment of s.x to s.x"