enum

package
v0.28.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package enum shows idiomatic way to implement an enumerated type:

  1. Create a new integer type.
  2. List its values using iota.
  3. Give the type a String function.

Based on yourbasic.org/golang/iota.

Level: beginner Topics: iota, enumerated type

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Direction

type Direction int
const (
	North Direction = iota
	South
	East
	West
)

Cardinal directions.

func (Direction) String

func (d Direction) String() string

Directories

Path Synopsis
Enum shows how to use enumerated type.
Enum shows how to use enumerated type.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL