decode

package
v0.0.0-...-8018142 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: MPL-2.0 Imports: 3 Imported by: 16

README

decode

GoDoc

Documentation

Overview

Package decode contains helper functions for turning mapstructure interfaces into simpler structs for configs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToSlice

func ToSlice(raw interface{}) []interface{}

ToSlice converts an interface{} to a slice of interfaces{}

func ToStrings

func ToStrings(raw interface{}) ([]string, error)

ToStrings converts the given interface{} to a []string, or returns an error. In the case where the argument is a string already, will wrap the arg in a slice.

func ToStruct

func ToStruct(raw interface{}, result interface{}) error

ToStruct decodes a raw interface{} into the target struct

Types

This section is empty.

Jump to

Keyboard shortcuts

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