struct_

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmptyStruct added in v0.0.3

func EmptyStruct() error

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

func Struct01

func Struct01() error

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

func Struct02

func Struct02() error

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

func Struct03

func Struct03() error

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

func Struct04

func Struct04() error

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

func StructAnonymousStruct added in v0.0.3

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