enum

package
v0.5.18 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 3 Imported by: 0

README

サンプルリスト

このディレクトリには以下のサンプルがあります。

file example name note
iota_basic.go iota_basic iota の基本的な使い方のサンプルです.
go_enums.go go_enums Go における enum の扱い方についてのサンプルです
go_iota.go go_iota Go における iota の扱い方についてのサンプルです

Documentation

Overview

Package enum -- Goでの enum についてのサンプルが配置されているパッケージです。

Index

Constants

View Source
const (
	FirstValue int = iota // 最初の値は 0 からスタート
	SecondValue
	ThirdValue
)

定数

Variables

This section is empty.

Functions

func Basic

func Basic() error

Basic は、iota の基本的な使い方のサンプルです.

func GoEnums

func GoEnums() error

GoEnums -- Go における enum の扱い方についてのサンプルです

REFERNCES:

-https://blog.learngoprogramming.com/golang-const-type-enums-iota-bc4befd096d3

func GoIota

func GoIota() error

GoIota -- Go における iota の扱い方についてのサンプルです

REFERENCES

noinspection GoBoolExpressions

func NewRegister

func NewRegister() mapping.Register

NewRegister -- このパッケージ用のサンプルを登録する mapping.Register を生成します。

Types

type ByteSize

type ByteSize int64

ByteSize -- バイトサイズ

const (
	KB ByteSize = 1 << (10 * iota)
	MB
	GB
	TB
)

noinspection GoUnusedConst

type Status

type Status int

Status -- サンプル用 enum. 何かのステータスを表す

const (
	Unknown Status = 0 // 不明
	Running Status = 1 // 実行中
	Stopped Status = 2 // 停止中
)

ステータス値

func (Status) CanForward

func (s Status) CanForward() bool

CanForward -- 先に進めることができるかどうかを返す

可能な場合は true, それ以外は false

func (Status) String

func (s Status) String() string

impl -- fmt.Stringer

type Weekday

type Weekday int

Weekday -- 曜日

const (
	Sunday Weekday = iota + 1 // iota は 0

	Monday  // iota は 2, (2 + 1) で 3 となる
	Tuesday // iota は 3, (3 + 1) で 4 となる
)

曜日

Jump to

Keyboard shortcuts

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