featureflags

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

Package featureflags evaluates feature flags: a small rule engine that decides, from a JSON schema and the context of a request, whether a feature is on, or which value it takes. It is the Go side of Powertools' Feature Flags utility, and reads the same schema.

Getting started

A FeatureFlags reads its schema from a Store, by default an AWS AppConfig freeform configuration profile. Create both once and share them:

var flags = featureflags.New(
	featureflags.AppConfigStoreFromConfig(cfg, "product-catalogue", "dev", "features"),
)

func handle(ctx context.Context, event Event) (Response, error) {
	premium, err := flags.Evaluate(ctx, "premium_features",
		map[string]any{"tier": event.Tier}, false)
	...
}

Evaluate returns, for the feature name and the context:

  • the when_match of the first rule whose conditions all match;
  • the feature's default when it has no rules or none matches;
  • the caller's default when the feature does not exist, or when the store could not provide the schema (an unreachable AppConfig).

The type is inferred from the default: a bool for a boolean feature, any Go type the JSON value of a non-boolean feature ("boolean_type": false) decodes into. EnabledFeatures returns the names of the features enabled for a context.

Schema

{
  "premium_features": {
    "default": false,
    "rules": {
      "customer tier equals premium": {
        "when_match": true,
        "conditions": [{"action": "EQUALS", "key": "tier", "value": "premium"}]
      }
    }
  }
}

Rules are tried in the order the document lists them; the conditions of a rule must all match. A condition whose key is missing from the context never matches, whatever its action. The actions are the RuleAction constants, with Python's semantics on JSON values: numbers compare by value whatever their type (true equals 1), strings by code point, lists member by member; KEY_IN_VALUE and its relatives test membership in a list, a substring of a string, or a key of an object. The time actions read the clock in the condition's TIMEZONE (an IANA name, UTC by default) from an embedded zone database, so they work on any Lambda runtime; WithClock replaces the clock in tests. MODULO_RANGE uses Python's floored modulo.

Validate checks a schema the way Python's SchemaValidator does, with its messages, which never include condition values; use it in a test or a CI step. FeatureFlags validates each new document once.

Stores

Store is one method, GetConfiguration, which returns the schema as raw JSON. AppConfigStore reads it through package parameters/appconfig, caching it for five seconds (WithMaxAge) and never polling sooner than AppConfig allows. WithEnvelope selects the schema inside a larger document with a JMESPath expression (package jmespath, with the Powertools functions); GetRawConfiguration returns the whole document. An AppConfig access denied is a *StoreClientError, returned by Evaluate; any other failure to read the document is a *ConfigurationStoreError, which Evaluate turns into the caller's default.

Errors and warnings

A condition whose operands cannot be compared (a number for STARTSWITH, a string for ANY_IN_VALUE) does not match. Python emits a PowertoolsUserWarning for it: here the warning goes to the handler of WithWarningHandler, by default once per distinct message as a JSON record on standard error. WithConditionErrorHandler, Python's validation_exception_handler, may decide the condition instead, or fail the evaluation; it receives a *ConditionError that matches ErrOperandType, ErrOperandNotString or ErrOperandNotList (Python's TypeError, AttributeError and ValueError).

Differences from Python

  • Evaluate is generic and returns an error: a value that does not fit the type asked for is a *ValueTypeError, the default coming back with it.
  • A document is validated again only when its bytes change; Python compares object identity.
  • The envelope keeps the order of the document's objects, as Python's dicts do. Objects the expression builds itself (powertools_json of a string, a multiselect) come out with their keys sorted.
  • Context values are read through JSON: a Go struct is an object, a slice a list. Integers are exact up to int64; Python's are unbounded.
  • Fixed: EnabledFeatures treats "rules": [] or null as no rules; Python raises AttributeError when the default is false.
  • Fixed: the "'TIMEZONE' must be a string" message names the rule; Python prints the str builtin.
  • TIMEZONE must be an IANA zone name; Python's dateutil also accepts POSIX TZ strings ("EST5EDT"). ISO datetimes follow Python 3.10's fromisoformat, the oldest Python Powertools supports.
  • Validate returns the warnings instead of emitting them; an action that is not a string fails validation instead of raising TypeError.
  • The AppConfig "Feature Flags" profile type is not supported, as in Python; the botocore user agent registration is not ported.

Index

Examples

Constants

View Source
const (
	CurrentTime      = "CURRENT_TIME"
	CurrentDatetime  = "CURRENT_DATETIME"
	CurrentDayOfWeek = "CURRENT_DAY_OF_WEEK"
)

The keys of time conditions, and of the members of their values.

View Source
const DefaultMaxAge = 5 * time.Second

DefaultMaxAge is how long AppConfigStore keeps a configuration before asking AppConfig again, as Python's max_age=5.

Variables

View Source
var (
	// ErrConfigurationStore: the store could not provide the configuration
	// (a network failure, a document that is not JSON). Evaluate and
	// EnabledFeatures absorb it and return the caller's default, as Python
	// does.
	ErrConfigurationStore = errors.New("unable to get the feature flags configuration")
	// ErrStoreClient: the store refused the request for a reason the caller
	// must hear about, such as missing permissions. It is never absorbed.
	ErrStoreClient = errors.New("feature flags store client error")
	// ErrSchemaValidation: the configuration is not a valid feature flags
	// schema. It is never absorbed.
	ErrSchemaValidation = errors.New("invalid feature flags schema")
	// ErrValueType: the value of a feature does not fit the Go type the
	// caller asked for.
	ErrValueType = errors.New("feature value does not fit the requested type")
	// ErrInvalidContext: the evaluation context holds a value that does not
	// marshal to JSON.
	ErrInvalidContext = errors.New("evaluation context is not JSON")
)

The sentinel errors of the package, for errors.Is.

View Source
var (
	// ErrOperandType stands for Python's TypeError: operands of types the
	// action cannot compare, such as a string and a number.
	ErrOperandType = errors.New("operands have unsupported types")
	// ErrOperandNotString stands for Python's AttributeError: STARTSWITH or
	// ENDSWITH on a context value that is not a string.
	ErrOperandNotString = errors.New("operand is not a string")
	// ErrOperandNotList stands for Python's ValueError: ANY_IN_VALUE,
	// ALL_IN_VALUE or NONE_IN_VALUE on a context value that is not a list.
	ErrOperandNotList = errors.New("operand is not a list")
)

The errors a condition can meet while comparing its operands, named after the Python exceptions they stand for. A ConditionError wraps one of them.

Functions

func Validate

func Validate(doc []byte) (warnings []string, err error)

Validate checks that doc is a valid feature flags schema, the way Python's SchemaValidator does, and returns the warnings Python would emit for it (a schema without features, a feature whose rules are empty). Use it to check a configuration before deploying it, in a test or a CI step.

A failure is a *SchemaValidationError with Python's message, which names features and rules but never condition values. A document that is not JSON is a *SchemaValidationError too.

Example
package main

import (
	"fmt"

	"github.com/alessandrolattao/powertools-lambda-go/featureflags"
)

func main() {
	_, err := featureflags.Validate([]byte(`{"premium_features": {"default": "yes"}}`))
	fmt.Println(err)
}
Output:
feature 'default' boolean key must be present, feature=premium_features

Types

type AppConfigStore

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

AppConfigStore reads the feature flags schema from an AWS AppConfig freeform configuration profile: Python's AppConfigStore. It reads through a parameters/appconfig provider, so it keeps the AppConfigData session of the profile and honors the poll interval AppConfig asks for. It is safe for concurrent use.

The AppConfig "Feature Flags" profile type (AWS.AppConfig.FeatureFlags) has another format and is not supported, as in Python.

func AppConfigStoreFromConfig

func AppConfigStoreFromConfig(cfg aws.Config, application, environment, profile string, opts ...AppConfigStoreOption) *AppConfigStore

AppConfigStoreFromConfig returns a store with an AppConfigData client built from cfg.

func NewAppConfigStore

func NewAppConfigStore(client appconfig.Client, application, environment, profile string, opts ...AppConfigStoreOption) *AppConfigStore

NewAppConfigStore returns a store that reads a configuration profile of application in environment through client. An empty application means POWERTOOLS_SERVICE_NAME, as in parameters/appconfig.

func (*AppConfigStore) GetConfiguration

func (s *AppConfigStore) GetConfiguration(ctx context.Context) (jsontext.Value, error)

GetConfiguration returns the feature flags: the configuration document, or what the envelope selects in it. The selection is computed once per version of the document. An envelope that cannot be compiled or evaluated returns a *jmespath.EnvelopeError, which Evaluate passes on.

func (*AppConfigStore) GetRawConfiguration

func (s *AppConfigStore) GetRawConfiguration(ctx context.Context) (jsontext.Value, error)

GetRawConfiguration returns the whole configuration document, before the envelope: Python's get_raw_configuration. An access denied is a *StoreClientError, any other failure (AppConfig unreachable, a document that is not JSON) a *ConfigurationStoreError.

type AppConfigStoreOption

type AppConfigStoreOption func(*AppConfigStore)

AppConfigStoreOption configures an AppConfigStore.

func WithEnvelope

func WithEnvelope(expression string) AppConfigStoreOption

WithEnvelope selects the feature flags in a larger document with a JMESPath expression, for example "features" or "app.features". The Powertools JMESPath functions (powertools_json, powertools_base64, powertools_base64_gzip) are available.

func WithJMESPathFunctions

func WithJMESPathFunctions(functions ...jmespath.Function) AppConfigStoreOption

WithJMESPathFunctions makes custom functions available to the envelope, Python's jmespath_options. The Powertools functions stay available.

func WithMaxAge

func WithMaxAge(d time.Duration) AppConfigStoreOption

WithMaxAge keeps the configuration for d before asking AppConfig again, DefaultMaxAge (five seconds) by default. AppConfig is never polled sooner than the poll interval of the session, whatever d says.

type ConditionError

type ConditionError struct {
	Feature string
	Rule    string
	Key     string
	Action  string
	// ExceptionType is the Python exception the failure stands for:
	// TypeError, AttributeError or ValueError.
	ExceptionType string
	Err           error
}

ConditionError reports a condition whose operands could not be compared, for example a context value that is a number for a STARTSWITH action. The condition does not match, unless a handler set with WithConditionErrorHandler decides otherwise. The error names the condition, never its operands.

func (*ConditionError) Error

func (e *ConditionError) Error() string

func (*ConditionError) Unwrap

func (e *ConditionError) Unwrap() error

Unwrap returns the cause, which matches ErrOperandType, ErrOperandNotString or ErrOperandNotList.

type ConfigurationStoreError

type ConfigurationStoreError struct {
	Message string
	Err     error
}

ConfigurationStoreError reports a configuration the store could not provide: Python's ConfigurationStoreError.

func (*ConfigurationStoreError) Error

func (e *ConfigurationStoreError) Error() string

func (*ConfigurationStoreError) Is

func (*ConfigurationStoreError) Is(target error) bool

Is makes the error match ErrConfigurationStore.

func (*ConfigurationStoreError) Unwrap

func (e *ConfigurationStoreError) Unwrap() error

Unwrap returns the cause.

type FeatureFlags

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

FeatureFlags evaluates feature flags against a context: Python's FeatureFlags. It is safe for concurrent use: create it once and share it across invocations.

func New

func New(store Store, opts ...Option) *FeatureFlags

New returns a FeatureFlags that reads its schema from store.

func (*FeatureFlags) Configuration

func (f *FeatureFlags) Configuration(ctx context.Context) (jsontext.Value, error)

Configuration returns the validated schema, as JSON: Python's get_configuration. A failure of the store is returned as it is, here.

func (*FeatureFlags) EnabledFeatures

func (f *FeatureFlags) EnabledFeatures(ctx context.Context, evalCtx map[string]any) ([]string, error)

EnabledFeatures returns the names of the features that are enabled for evalCtx, in document order: Python's get_enabled_features. A feature is enabled when its default is truthy and it has no rules, or when its rules give a truthy value; so a non-boolean feature whose value is a non-empty list or object counts, as in Python. When the store cannot provide the schema the list is empty.

Example
package main

import (
	"context"
	"encoding/json/jsontext"
	"fmt"
	"time"

	"github.com/alessandrolattao/powertools-lambda-go/featureflags"
)

// memoryStore is a custom store: a fixed document. A real one would read S3,
// a database, a file.
type memoryStore jsontext.Value

func (s memoryStore) GetConfiguration(context.Context) (jsontext.Value, error) {
	return jsontext.Value(s), nil
}

const schema = `{
	"premium_features": {
		"default": false,
		"rules": {
			"customer tier equals premium": {
				"when_match": true,
				"conditions": [{"action": "EQUALS", "key": "tier", "value": "premium"}]
			}
		}
	},
	"ten_percent_off_campaign": {"default": true},
	"discount": {
		"default": {"percent": 0},
		"boolean_type": false,
		"rules": {
			"loyal customers": {
				"when_match": {"percent": 15},
				"conditions": [{"action": "KEY_GREATER_THAN_OR_EQUAL_VALUE", "key": "years", "value": 3}]
			}
		}
	},
	"weekend_sale": {
		"default": false,
		"rules": {
			"saturday and sunday": {
				"when_match": true,
				"conditions": [{"action": "SCHEDULE_BETWEEN_DAYS_OF_WEEK", "key": "CURRENT_DAY_OF_WEEK",
					"value": {"DAYS": ["SATURDAY", "SUNDAY"], "TIMEZONE": "Europe/Rome"}}]
			}
		}
	}
}`

func main() {
	saturday := time.Date(2026, 10, 10, 12, 0, 0, 0, time.UTC)
	flags := featureflags.New(memoryStore(schema), featureflags.WithClock(func() time.Time { return saturday }))

	enabled, err := flags.EnabledFeatures(context.Background(), map[string]any{"tier": "premium"})
	if err != nil {
		panic(err)
	}
	fmt.Println(enabled)
}
Output:
[premium_features ten_percent_off_campaign discount weekend_sale]

func (*FeatureFlags) Evaluate

func (f *FeatureFlags) Evaluate[T any](ctx context.Context, name string, evalCtx map[string]any, def T) (T, error)

Evaluate returns the value of the feature name for the context evalCtx: Python's evaluate.

  • The feature exists and a rule matches: the rule's when_match.
  • The feature exists, it has no rules or none matches: its default.
  • The feature does not exist, or the store could not provide the schema (ErrConfigurationStore): def, with a nil error.

A boolean feature (the default kind) gives a bool; one with "boolean_type": false gives any JSON value, which is decoded into T. A value that does not fit T returns def and a *ValueTypeError. A schema that does not validate and a store that refuses the request return def and the error. evalCtx may hold any value that marshals to JSON; nil is an empty context.

Example
package main

import (
	"context"
	"encoding/json/jsontext"
	"fmt"

	"github.com/alessandrolattao/powertools-lambda-go/featureflags"
)

// memoryStore is a custom store: a fixed document. A real one would read S3,
// a database, a file.
type memoryStore jsontext.Value

func (s memoryStore) GetConfiguration(context.Context) (jsontext.Value, error) {
	return jsontext.Value(s), nil
}

const schema = `{
	"premium_features": {
		"default": false,
		"rules": {
			"customer tier equals premium": {
				"when_match": true,
				"conditions": [{"action": "EQUALS", "key": "tier", "value": "premium"}]
			}
		}
	},
	"ten_percent_off_campaign": {"default": true},
	"discount": {
		"default": {"percent": 0},
		"boolean_type": false,
		"rules": {
			"loyal customers": {
				"when_match": {"percent": 15},
				"conditions": [{"action": "KEY_GREATER_THAN_OR_EQUAL_VALUE", "key": "years", "value": 3}]
			}
		}
	},
	"weekend_sale": {
		"default": false,
		"rules": {
			"saturday and sunday": {
				"when_match": true,
				"conditions": [{"action": "SCHEDULE_BETWEEN_DAYS_OF_WEEK", "key": "CURRENT_DAY_OF_WEEK",
					"value": {"DAYS": ["SATURDAY", "SUNDAY"], "TIMEZONE": "Europe/Rome"}}]
			}
		}
	}
}`

func main() {
	flags := featureflags.New(memoryStore(schema))
	ctx := context.Background()

	premium, err := flags.Evaluate(ctx, "premium_features", map[string]any{"tier": "premium"}, false)
	if err != nil {
		panic(err)
	}
	standard, err := flags.Evaluate(ctx, "premium_features", map[string]any{"tier": "standard"}, false)
	if err != nil {
		panic(err)
	}
	missing, err := flags.Evaluate(ctx, "no_such_feature", nil, true)
	if err != nil {
		panic(err)
	}
	fmt.Println(premium, standard, missing)
}
Output:
true false true
Example (NonBoolean)
package main

import (
	"context"
	"encoding/json/jsontext"
	"fmt"

	"github.com/alessandrolattao/powertools-lambda-go/featureflags"
)

// memoryStore is a custom store: a fixed document. A real one would read S3,
// a database, a file.
type memoryStore jsontext.Value

func (s memoryStore) GetConfiguration(context.Context) (jsontext.Value, error) {
	return jsontext.Value(s), nil
}

const schema = `{
	"premium_features": {
		"default": false,
		"rules": {
			"customer tier equals premium": {
				"when_match": true,
				"conditions": [{"action": "EQUALS", "key": "tier", "value": "premium"}]
			}
		}
	},
	"ten_percent_off_campaign": {"default": true},
	"discount": {
		"default": {"percent": 0},
		"boolean_type": false,
		"rules": {
			"loyal customers": {
				"when_match": {"percent": 15},
				"conditions": [{"action": "KEY_GREATER_THAN_OR_EQUAL_VALUE", "key": "years", "value": 3}]
			}
		}
	},
	"weekend_sale": {
		"default": false,
		"rules": {
			"saturday and sunday": {
				"when_match": true,
				"conditions": [{"action": "SCHEDULE_BETWEEN_DAYS_OF_WEEK", "key": "CURRENT_DAY_OF_WEEK",
					"value": {"DAYS": ["SATURDAY", "SUNDAY"], "TIMEZONE": "Europe/Rome"}}]
			}
		}
	}
}`

func main() {
	type discount struct {
		Percent int `json:"percent"`
	}
	flags := featureflags.New(memoryStore(schema))

	got, err := flags.Evaluate(context.Background(), "discount", map[string]any{"years": 5}, discount{})
	if err != nil {
		panic(err)
	}
	fmt.Println(got.Percent)
}
Output:
15

type Option

type Option func(*FeatureFlags)

Option configures a FeatureFlags.

func WithClock

func WithClock(now func() time.Time) Option

WithClock replaces the clock of the time conditions, for tests.

func WithConditionErrorHandler

func WithConditionErrorHandler(handler func(failure *ConditionError) (matched bool, err error)) Option

WithConditionErrorHandler decides what a condition whose operands cannot be compared evaluates to: Python's validation_exception_handler. The handler receives the failure (errors.Is tells ErrOperandType, ErrOperandNotString and ErrOperandNotList apart, as Python's handlers are registered per exception class) and returns whether the condition matches; an error it returns fails the evaluation. Without a handler such a condition does not match.

As in Python, the handler also sees the failures of conditions whose key is missing from the context, and may make them match.

func WithWarningHandler

func WithWarningHandler(handler func(message string)) Option

WithWarningHandler receives the warnings Python emits as PowertoolsUserWarning: an empty schema, a feature with empty rules, a condition that could not be evaluated. By default each distinct warning is written once, as a JSON record on standard error where Lambda collects it, the way Python shows a warning once per place.

type RuleAction

type RuleAction string

RuleAction is the action of a condition: how the context value (the key) is compared with the condition value.

const (
	// Equals: key == value.
	Equals RuleAction = "EQUALS"
	// NotEquals: key != value.
	NotEquals RuleAction = "NOT_EQUALS"
	// KeyGreaterThanValue: key > value.
	KeyGreaterThanValue RuleAction = "KEY_GREATER_THAN_VALUE"
	// KeyGreaterThanOrEqualValue: key >= value.
	KeyGreaterThanOrEqualValue RuleAction = "KEY_GREATER_THAN_OR_EQUAL_VALUE"
	// KeyLessThanValue: key < value.
	KeyLessThanValue RuleAction = "KEY_LESS_THAN_VALUE"
	// KeyLessThanOrEqualValue: key <= value.
	KeyLessThanOrEqualValue RuleAction = "KEY_LESS_THAN_OR_EQUAL_VALUE"
	// StartsWith: the key string starts with the value string.
	StartsWith RuleAction = "STARTSWITH"
	// EndsWith: the key string ends with the value string.
	EndsWith RuleAction = "ENDSWITH"
	// In is KeyInValue under its older name.
	In RuleAction = "IN"
	// NotIn is KeyNotInValue under its older name.
	NotIn RuleAction = "NOT_IN"
	// KeyInValue: key is a member of the value list, a substring of the
	// value string, or a key of the value object.
	KeyInValue RuleAction = "KEY_IN_VALUE"
	// KeyNotInValue: the negation of KeyInValue.
	KeyNotInValue RuleAction = "KEY_NOT_IN_VALUE"
	// ValueInKey: value is a member of the key list, a substring of the key
	// string, or a key of the key object.
	ValueInKey RuleAction = "VALUE_IN_KEY"
	// ValueNotInKey: the negation of ValueInKey.
	ValueNotInKey RuleAction = "VALUE_NOT_IN_KEY"
	// AllInValue: every member of the key list is in the value list.
	AllInValue RuleAction = "ALL_IN_VALUE"
	// AnyInValue: at least one member of the key list is in the value list.
	AnyInValue RuleAction = "ANY_IN_VALUE"
	// NoneInValue: no member of the key list is in the value list.
	NoneInValue RuleAction = "NONE_IN_VALUE"
	// ScheduleBetweenTimeRange: the current time of day is between START and
	// END ("HH:MM", both included; a range whose end comes before its start
	// crosses midnight), in TIMEZONE (UTC by default). The key is
	// CURRENT_TIME.
	ScheduleBetweenTimeRange RuleAction = "SCHEDULE_BETWEEN_TIME_RANGE"
	// ScheduleBetweenDatetimeRange: the current date and time is between
	// START and END (ISO 8601 without offset, both included), in TIMEZONE.
	// The key is CURRENT_DATETIME.
	ScheduleBetweenDatetimeRange RuleAction = "SCHEDULE_BETWEEN_DATETIME_RANGE"
	// ScheduleBetweenDaysOfWeek: the current day of the week, in TIMEZONE,
	// is one of DAYS (MONDAY to SUNDAY). The key is CURRENT_DAY_OF_WEEK.
	ScheduleBetweenDaysOfWeek RuleAction = "SCHEDULE_BETWEEN_DAYS_OF_WEEK"
	// ModuloRange: START <= key % BASE <= END, for a numeric key: a stable
	// way to enable a feature for a share of users.
	ModuloRange RuleAction = "MODULO_RANGE"
)

The actions a condition can take. In the descriptions, key is the context value the condition names and value is the condition's value.

func RuleActions

func RuleActions() []RuleAction

RuleActions lists every action, in the order Python's RuleAction declares them.

type SchemaValidationError

type SchemaValidationError struct {
	Message string
}

SchemaValidationError reports a configuration that is not a valid feature flags schema: Python's SchemaValidationError, with its messages. The messages name features and rules, never condition values, which may hold personal data.

func (*SchemaValidationError) Error

func (e *SchemaValidationError) Error() string

func (*SchemaValidationError) Is

func (*SchemaValidationError) Is(target error) bool

Is makes the error match ErrSchemaValidation.

type Store

type Store interface {
	GetConfiguration(ctx context.Context) (jsontext.Value, error)
}

Store provides the feature flags document: Python's StoreProvider. A custom store (S3, a database, a file) implements it.

GetConfiguration returns the schema as raw JSON, after any envelope. Features and rules are evaluated in the order the document lists them. A store reports a document it cannot provide with a *ConfigurationStoreError (Evaluate then returns the caller's default) and a refusal the caller must hear about with a *StoreClientError; other errors are returned as they are. FeatureFlags validates a document once and reuses it while the store returns the same bytes.

type StoreClientError

type StoreClientError struct {
	Err error
}

StoreClientError reports a request the store refused, such as an access denied: Python's StoreClientError.

func (*StoreClientError) Error

func (e *StoreClientError) Error() string

func (*StoreClientError) Is

func (*StoreClientError) Is(target error) bool

Is makes the error match ErrStoreClient.

func (*StoreClientError) Unwrap

func (e *StoreClientError) Unwrap() error

Unwrap returns the cause.

type ValueTypeError

type ValueTypeError struct {
	Feature string
	Err     error
}

ValueTypeError reports a feature value that does not fit the type the caller of Evaluate asked for.

func (*ValueTypeError) Error

func (e *ValueTypeError) Error() string

func (*ValueTypeError) Is

func (*ValueTypeError) Is(target error) bool

Is makes the error match ErrValueType.

func (*ValueTypeError) Unwrap

func (e *ValueTypeError) Unwrap() error

Unwrap returns the cause.

Jump to

Keyboard shortcuts

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