Sobes.tech
Junior

What is placed before the method name in the Go language?

sobes.tech AI

Answer from AI

Method receiver.

// Example struct
type Example struct {
	value int
}

// MyMethod with receiver of type Example
func (e Example) MyMethod() int {
	return e.value * 2
}