! unparam .
cmp stdout stdout.golden

-- go.mod --
module testdata.tld/foo
-- stdout.golden --
foo.go:9:22: singleIgnored - result 0 (rune) is never used
foo.go:30:27: singleIgnoredName - result r is never used
foo.go:40:33: singleIgnoredUnderscore - result 0 (rune) is never used
foo.go:50:20: allIgnored - result 0 (int) is never used
foo.go:50:25: allIgnored - result 1 (string) is never used
foo.go:60:26: someIgnored - result 1 (string) is never used
foo.go:85:29: ignoredGoDefer - result 1 (string) is never used
-- foo.go --
package foo

import "errors"

var DoWork func()

var Cond bool

func singleIgnored() rune {
	DoWork()
	return '0'
}

func SingleIgnoredUse() {
	singleIgnored()
	_ = singleIgnored()
}

func singleNotIgnored() rune {
	DoWork()
	return '0'
}

func SingleNotIgnoredUse() {
	singleNotIgnored()
	r := singleNotIgnored()
	println(r)
}

func singleIgnoredName() (r rune) {
	DoWork()
	return '0'
}

func SingleIgnoredNameUse() {
	singleIgnoredName()
	_ = singleIgnoredName()
}

func singleIgnoredUnderscore() (_ rune) {
	DoWork()
	return '0'
}

func SingleIgnoredUnderscoreUse() {
	singleIgnoredUnderscore()
	_ = singleIgnoredUnderscore()
}

func allIgnored() (int, string) {
	DoWork()
	return 2, "foo"
}

func AllIgnoredUse() {
	allIgnored()
	_, _ = allIgnored()
}

func someIgnored() (int, string) {
	DoWork()
	return 2, "foo"
}

func SomeIgnoredUse() {
	someIgnored()
	i, _ := someIgnored()
	println(i)
}

func errorIgnored() (int, error) {
	DoWork()
	if Cond {
		return 3, errors.New("foo")
	}
	return 2, nil
}

func ErrorIgnoredUse() {
	errorIgnored()
	i, _ := errorIgnored()
	println(i)
}

func ignoredGoDefer() (int, string) {
	DoWork()
	return 2, "bar"
}

func IgnoredGoDeferUse() {
	go ignoredGoDefer()
	defer ignoredGoDefer()
	i, _ := ignoredGoDefer()
	println(i)
}
