! unparam .
cmp stdout stdout.golden

-- go.mod --
module testdata.tld/foo
-- stdout.golden --
foo.go:9:23: receivesSameMany - f always receives 3
foo.go:16:26: receivesSameManyLit - r always receives 'a' (97)
foo.go:23:28: receivesSameManyNamed - f always receives FooConst (123)
foo.go:30:28: receivesSameManyMixed - f always receives 123
foo.go:72:32: receivesSameFromGenerated - f always receives int(2) (2)
foo.go:79:22: receivesSameNil - v always receives nil
foo.go:86:28: receivesSameInterface - v always receives 123
-- foo.go --
package foo

import "math/rand"

var DoWork func()

const FooConst = 123

func receivesSameMany(f int) {
	DoWork()
	if f == 0 {
		println(f)
	}
}

func receivesSameManyLit(r rune) {
	DoWork()
	if r == '0' {
		println(r)
	}
}

func receivesSameManyNamed(f int) {
	DoWork()
	if f == 0 {
		println(f)
	}
}

func receivesSameManyMixed(f int) {
	DoWork()
	if f == 1 {
		println(f)
	}
}

func receivesSameOnce(r rune) {
	DoWork()
	if r == '1' {
		println(r)
	}
}

func receivesDifferent(r rune) {
	DoWork()
	if r == '0' {
		println(r)
	}
}

func ReceivesSameExported(r rune) {
	DoWork()
	if r == '0' {
		println(r)
	}
}

func receivesCallExpr(r rune) {
	DoWork()
	if r == '0' {
		println(r)
	}
}

func randRune() rune { return rune(rand.Int31()) }

func withVariadic(s ...string) {
	DoWork()
	println(len(s))
}

func receivesSameFromGenerated(f int) {
	DoWork()
	if f == 4 {
		println(f)
	}
}

func receivesSameNil(v interface{}) {
	DoWork()
	if v != nil {
		println(v)
	}
}

func receivesSameInterface(v interface{}) {
	DoWork()
	if v == false {
		println(v)
	}
}

func receivesInterfaceDiffType(v interface{}) {
	DoWork()
	if v == false {
		println(v)
	}
}

func CallReceivers() {
	receivesSameMany(3)
	receivesSameMany(3)
	receivesSameMany(3)
	receivesSameMany(3)
	receivesSameManyLit('a')
	receivesSameManyLit('a')
	receivesSameManyLit('a')
	receivesSameManyLit('a')
	receivesSameManyNamed(FooConst)
	receivesSameManyNamed(FooConst)
	receivesSameManyNamed(FooConst)
	receivesSameManyNamed(FooConst)
	receivesSameManyMixed(FooConst)
	receivesSameManyMixed(FooConst)
	receivesSameManyMixed(123)
	receivesSameManyMixed(int(123))
	receivesSameOnce('b')
	receivesDifferent('a')
	receivesDifferent('b')
	receivesDifferent('c')
	receivesDifferent('d')
	ReceivesSameExported('b')
	ReceivesSameExported('b')
	ReceivesSameExported('b')
	ReceivesSameExported('b')
	receivesCallExpr(randRune())
	receivesCallExpr(randRune())
	receivesCallExpr(randRune())
	receivesCallExpr(randRune())
	receivesSameNil(nil)
	receivesSameNil(nil)
	receivesSameNil(nil)
	receivesSameNil(nil)
	receivesSameInterface(123)
	receivesSameInterface(123)
	receivesSameInterface(123)
	receivesSameInterface(123)
	receivesInterfaceDiffType((*int)(nil))
	receivesInterfaceDiffType((*int)(nil))
	receivesInterfaceDiffType((*int)(nil))
	receivesInterfaceDiffType((*uint)(nil))
	withVariadic()
}
-- generated.go --
// Code generated by some-program. DO NOT EDIT.

package foo

func oneUnusedGenerated(a, b int) int {
	DoWork()
	a += 1
	return a
}

func GeneratedCalls() {
	receivesSameFromGenerated(int(2))
	receivesSameFromGenerated(int(2))
	receivesSameFromGenerated(int(2))
	receivesSameFromGenerated(int(2))
}
