structs

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Go言語の 構造体 についてのサンプルが配置されているパッケージです。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Basic01

func Basic01() error

構造体についてのサンプル noinspection GoUnhandledErrorResult

func Basic02

func Basic02() error

構造体が値型であることの確認 noinspection GoNilness

func Basic03

func Basic03() error

構造体間で共有するフィールド郡を共通化

func Basic04

func Basic04() error

組み込み関数 new() のサンプル

func EmptyStruct

func EmptyStruct() error

EmptyStruct は、空の構造体についサンプルです.

func NewRegister

func NewRegister() mappings.Register

func StructAnonymousStruct

func StructAnonymousStruct() error

Types

type A

type A struct {
	Base   // 共通フィールド
	ValueA string
}

type B

type B struct {
	Base   // 共通フィールド
	ValueB string
}

type Base

type Base struct {
	// contains filtered or unexported fields
}

type IntPair

type IntPair struct {
	// contains filtered or unexported fields
}

type MySt01

type MySt01 struct {
	// contains filtered or unexported fields
}

type MyStruct

type MyStruct struct {
	// 値
	Value int
}

サンプル用の構造体

func (*MyStruct) Method1

func (m *MyStruct) Method1() int

レシーバーがポインタの場合のメソッド

func (MyStruct) Method2

func (m MyStruct) Method2() int

レシーバーがポインタではない場合のメソッド

Jump to

Keyboard shortcuts

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