testexample

package
v0.24.3 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package testexample is a testing playground for mimchain

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error[T gogh.Importer] struct {
	// contains filtered or unexported fields
}

Error is a dedicated code renderer for chaining calls of errors.Error. The type provides constructor calls for the original type.

func R

func R[T gogh.Importer](r *gogh.GoRenderer[T], a ...any) *Error[T]

R creates `return ....` renderer with an error expression in it.

Usage example:

wrp.R(r).Wrapf("err", "do something").Int("count", 13)

Will be rendered into

return "", errors.Wrapf(err, "do something").Int("count", 13)

In a function returning (string, error).

Remember though, you need to have $ReturnZeroValues in the renderer context. It can be set by M or F method calls or directly using SetReturnZeroValues method. The availability of this context constant is not guaranteed for both M and F in a case the heuristics failed, so be careful with it.

func (*Error[T]) Just

func (x *Error[T]) Just(err any) *ErrorAttr[T]

Just call support.

func (*Error[T]) New

func (x *Error[T]) New(msg any) *ErrorAttr[T]

New call support.

func (*Error[T]) Newf

func (x *Error[T]) Newf(format any, a ...any) *ErrorAttr[T]

Newf call support.

func (*Error[T]) String

func (x *Error[T]) String() string

func (*Error[T]) Wrap

func (x *Error[T]) Wrap(err any, msg any) *ErrorAttr[T]

Wrap call support.

func (*Error[T]) Wrapf

func (x *Error[T]) Wrapf(err any, format any, a ...any) *ErrorAttr[T]

Wrapf call support.

type ErrorAttr

type ErrorAttr[T gogh.Importer] struct {
	// contains filtered or unexported fields
}

ErrorAttr is a dedicated code renderer for chaining calls of errors.Error. The type provides chaining calls of the original type.

func (*ErrorAttr[T]) Any

func (x *ErrorAttr[T]) Any(name any, value any) *ErrorAttr[T]

Any call support.

func (*ErrorAttr[T]) Bool

func (x *ErrorAttr[T]) Bool(name any, value any) *ErrorAttr[T]

Bool call support.

func (*ErrorAttr[T]) Float32

func (x *ErrorAttr[T]) Float32(name any, value any) *ErrorAttr[T]

Float32 call support.

func (*ErrorAttr[T]) Float64

func (x *ErrorAttr[T]) Float64(name any, value any) *ErrorAttr[T]

Float64 call support.

func (*ErrorAttr[T]) Int

func (x *ErrorAttr[T]) Int(name any, value any) *ErrorAttr[T]

Int call support.

func (*ErrorAttr[T]) Int8

func (x *ErrorAttr[T]) Int8(name any, value any) *ErrorAttr[T]

Int8 call support.

func (*ErrorAttr[T]) Int16

func (x *ErrorAttr[T]) Int16(name any, value any) *ErrorAttr[T]

Int16 call support.

func (*ErrorAttr[T]) Int32

func (x *ErrorAttr[T]) Int32(name any, value any) *ErrorAttr[T]

Int32 call support.

func (*ErrorAttr[T]) Int64

func (x *ErrorAttr[T]) Int64(name any, value any) *ErrorAttr[T]

Int64 call support.

func (*ErrorAttr[T]) Loc

func (x *ErrorAttr[T]) Loc(depth any) *ErrorAttr[T]

Loc call support.

func (*ErrorAttr[T]) Pfx

func (x *ErrorAttr[T]) Pfx(prefix any) *ErrorAttr[T]

Pfx call support.

func (*ErrorAttr[T]) Stg

func (x *ErrorAttr[T]) Stg(name any, value any) *ErrorAttr[T]

Stg call support.

func (*ErrorAttr[T]) Str

func (x *ErrorAttr[T]) Str(name any, value any) *ErrorAttr[T]

Str call support.

func (*ErrorAttr[T]) String

func (x *ErrorAttr[T]) String() string

func (*ErrorAttr[T]) Strs

func (x *ErrorAttr[T]) Strs(name any, value any) *ErrorAttr[T]

Strs call support.

func (*ErrorAttr[T]) Type

func (x *ErrorAttr[T]) Type(name any, typ any) *ErrorAttr[T]

Type call support.

func (*ErrorAttr[T]) Uint

func (x *ErrorAttr[T]) Uint(name any, value any) *ErrorAttr[T]

Uint call support.

func (*ErrorAttr[T]) Uint8

func (x *ErrorAttr[T]) Uint8(name any, value any) *ErrorAttr[T]

Uint8 call support.

func (*ErrorAttr[T]) Uint16

func (x *ErrorAttr[T]) Uint16(name any, value any) *ErrorAttr[T]

Uint16 call support.

func (*ErrorAttr[T]) Uint32

func (x *ErrorAttr[T]) Uint32(name any, value any) *ErrorAttr[T]

Uint32 call support.

func (*ErrorAttr[T]) Uint64

func (x *ErrorAttr[T]) Uint64(name any, value any) *ErrorAttr[T]

Uint64 call support.

Jump to

Keyboard shortcuts

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