Skip to content

method String() not picked up by compiled code #228

Closed
@spolischook

Description

@spolischook

There is an example of code snippet that have different result of go run and gophernotes:

type Direction int

const (
	North Direction = iota
	East
	South
	West
)

func (d Direction) String() string {
	return [...]string{"North", "East", "South", "West"}[d]
}

func main() {
	fmt.Print(East)
}

gophernotes example:
Selection_412

go run example:
Selection_413

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions