gocmp

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 7 Imported by: 0

README

サンプルリスト

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

file example name note
basic.go gocmp_basic go-cmp の基本パターンについてのサンプルです
ignore.go gocmp_ignore go-cmp にて 指定したフィールド を無視して比較するサンプルです

Documentation

Overview

Package gocmp は、go-cmp 関連のサンプルが配置されています。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Basic

func Basic() error

Basic -- go-cmp の基本パターンについてのサンプルです.

func Ignore

func Ignore() error

Ignore -- go-cmp にて 指定したフィールド を無視して比較するサンプルです.

func NewRegister

func NewRegister() mapping.Register

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

Types

type A

type A struct {
	PublicField string
}

A -- サンプル用構造体

type B

type B struct {
	A
	// contains filtered or unexported fields
}

B -- サンプル用構造体

type C

type C A

C -- サンプル用構造体

func (C) Equal

func (c C) Equal(o C) bool

Equal -- 自身と指定された値が等しいかどうかを返します

等しい場合は true, それ以外は false です.

type D

type D struct {
	StrField  string    // パブリックな文字列フィールド
	TimeField time.Time // パブリックな日付フィールド
	// contains filtered or unexported fields
}

D -- サンプル用構造体

Jump to

Keyboard shortcuts

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