types

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: 4 Imported by: 0

README

サンプルリスト

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

file example name note
type01.go types_basic type についてのサンプルです
define_types_easy.go types_define_types_easy Goでは型定義が簡単であるということを示すサンプルです
diff_typealias_definedtype.go types_diff_typealias_and_definedtype Goでの Type Alias と Defined Type の違いについてのサンプルです

Documentation

Overview

Package types -- Go言語の 型定義 についてのサンプルが配置されているパッケージです。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Basic

func Basic() error

Basic は、type についてのサンプルです.

func DefineTypesEasy added in v0.2.8

func DefineTypesEasy() error

DefineTypesEasy -- Goでは型定義が簡単であるということを示すサンプルです.

func DiffTypeAliasAndDefinedType added in v0.4.2

func DiffTypeAliasAndDefinedType() error

DiffTypeAliasAndDefinedType -- Goでの Type Alias と Defined Type の違いについてのサンプルです.

個人的に、Type Alias はほぼ使ったことがない。基本的に Defined Type で事足りている。

REFERENCES

func NewRegister

func NewRegister() mapping.Register

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

Types

type Id added in v0.2.8

type Id string

型定義

type KeyValuePair

type KeyValuePair struct {
	Key   string
	Value interface{}
}

KeyValuePair -- 構造体の定義も struct で定義した内容を type で名前定義しているのと同じ

func NewKeyValuePair

func NewKeyValuePair(k string, v string) *KeyValuePair

NewKeyValuePair -- *KeyValuePair を生成

type MyInt1

type MyInt1 int

MyInt1 -- int に対して別名を定義

type MyInt2

type MyInt2 int

MyInt2 -- int に対して別名を定義

type MyIntArray

type MyIntArray [3]int

MyIntArray -- 配列に対して別名を定義

type Name added in v0.2.8

type Name string

型定義

type User added in v0.2.8

type User struct {
	Id   Id
	Name Name
}

型定義

func (User) String added in v0.2.8

func (me User) String() string

Jump to

Keyboard shortcuts

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