deprecated

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

This package are used to store all helpers functions used to validate and log deprecated functions and signatures in the project codebase. This is really useful to ensure no breaking changes are introduced from the migration of Sprig to Sprout.

This package will be removed when no deprecated functions are left in the project codebase (scheduled for v1.1).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrArgsCount

func ErrArgsCount(expected, got int) error

ErrArgsCount returns an error message about the number of arguments expected and received.

Parameters:

expected int - the number of arguments expected.
got int - the number of arguments received.

Returns:

error - the error message.

Example:

deprecated.ErrArgsCount(2, 3) // Output: "expected 2 arguments, got 3"

func SignatureWarn

func SignatureWarn(l *slog.Logger, functionName, oldSign, newSign string)

SignatureWarn logs a warning message about a deprecated function signature.

Parameters:

l *slog.Logger - the logger to use.
functionName string - the name of the function.
oldSign string - the old signature of the function.
newSign string - the new signature of the function.

Example:

deprecated.SignatureWarn(l, "get", "{{ get dict key }}", "{{ dict | get key }}")

Types

This section is empty.

Jump to

Keyboard shortcuts

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