2020-09-17 16:18:19 +00:00
|
|
|
package testdata
|
|
|
|
|
|
|
|
type foo struct {
|
|
|
|
}
|
|
|
|
|
2021-04-23 12:06:05 +00:00
|
|
|
// AddressOfDereferencedValue --
|
2020-09-17 16:18:19 +00:00
|
|
|
func AddressOfDereferencedValue() {
|
|
|
|
x := &foo{}
|
2020-09-29 11:29:40 +00:00
|
|
|
_ = &*x // want "Found a no-op instruction that can be safely removed. It might be a result of writing code that does not do what was intended."
|
2020-09-17 16:18:19 +00:00
|
|
|
}
|
|
|
|
|
2021-04-23 12:06:05 +00:00
|
|
|
// DereferencedAddressOfValue --
|
2020-09-17 16:18:19 +00:00
|
|
|
func DereferencedAddressOfValue() {
|
|
|
|
x := foo{}
|
2020-09-29 11:29:40 +00:00
|
|
|
_ = *&x // want "Found a no-op instruction that can be safely removed. It might be a result of writing code that does not do what was intended."
|
2020-09-17 16:18:19 +00:00
|
|
|
}
|